From cd41665eb3b202c92b7a487f3e4a0f291bc444a0 Mon Sep 17 00:00:00 2001 From: Maciej Komorowski Date: Fri, 14 Jul 2023 11:10:03 +0200 Subject: [PATCH] run prettier on the repository wip --- .code-generation/config.js | 113 +- .eslintrc | 41 +- .github/pull_request_template.md | 4 +- .husky/pre-commit | 4 + .prettierrc.json | 3 + .release-it.json | 4 +- CHANGELOG.md | 55 +- README.md | 67 +- __DOCS__/JSDocTemplate/.test/CustomError.html | 490 +- .../JSDocTemplate/.test/CustomError.js.html | 355 +- __DOCS__/JSDocTemplate/.test/GlobalClass.html | 1048 +-- .../JSDocTemplate/.test/GlobalClass.js.html | 467 +- __DOCS__/JSDocTemplate/.test/MyApi.Child.html | 1443 ++-- __DOCS__/JSDocTemplate/.test/MyApi.Class.html | 1834 +++-- __DOCS__/JSDocTemplate/.test/MyApi.html | 768 +- __DOCS__/JSDocTemplate/.test/MyApi.js.html | 659 +- __DOCS__/JSDocTemplate/.test/MyApi.utils.html | 598 +- .../JSDocTemplate/.test/MyApi.utils.js.html | 371 +- .../JSDocTemplate/.test/css/bootstrap.min.css | 6976 +++++++++++++++- __DOCS__/JSDocTemplate/.test/css/prism.css | 114 +- .../JSDocTemplate/.test/css/prism.min.css | 281 +- .../JSDocTemplate/.test/css/template.min.css | 538 +- __DOCS__/JSDocTemplate/.test/global.html | 470 +- __DOCS__/JSDocTemplate/.test/index.html | 998 ++- .../JSDocTemplate/.test/js/bootstrap.min.js | 1411 +++- .../JSDocTemplate/.test/js/clipboard.min.js | 550 +- __DOCS__/JSDocTemplate/.test/js/jquery.min.js | 4647 ++++++++++- __DOCS__/JSDocTemplate/.test/js/lunr-data.js | 7005 ++++++++--------- .../JSDocTemplate/.test/js/lunr-data.json | 88 +- __DOCS__/JSDocTemplate/.test/js/lunr.min.js | 752 +- __DOCS__/JSDocTemplate/.test/js/prism.js | 1600 ++-- __DOCS__/JSDocTemplate/.test/js/prism.min.js | 776 +- .../JSDocTemplate/.test/js/template.min.js | 486 +- __DOCS__/JSDocTemplate/.test/list_class.html | 455 +- .../JSDocTemplate/.test/list_namespace.html | 390 +- .../JSDocTemplate/.test/list_tutorial.html | 416 +- .../.test/tutorial-brush-teeth.html | 510 +- .../.test/tutorial-drive-car.html | 384 +- .../.test/tutorial-fence-test.html | 378 +- __DOCS__/JSDocTemplate/Gruntfile.js | 571 +- __DOCS__/JSDocTemplate/README.md | 668 +- __DOCS__/JSDocTemplate/src/conf.json | 70 +- __DOCS__/JSDocTemplate/src/publish.js | 12 +- .../src/static/css/access-filter.css | 78 +- .../src/static/css/anchor-link.css | 52 +- .../src/static/css/breadcrumbs.css | 6 +- .../JSDocTemplate/src/static/css/callout.css | 198 +- .../src/static/css/dummy-console.css | 12 +- .../src/static/css/lunr-search.css | 116 +- .../src/static/css/page-header.css | 158 +- .../src/static/css/prism-line-numbers.css | 59 +- .../src/static/css/prism-theme-overrides.css | 127 +- .../src/static/css/prism-toolbar.css | 130 +- .../src/static/css/related-tutorials.css | 18 +- .../JSDocTemplate/src/static/css/site.css | 80 +- .../JSDocTemplate/src/static/css/symbols.css | 100 +- .../JSDocTemplate/src/static/css/tags.css | 24 +- __DOCS__/JSDocTemplate/src/static/css/toc.css | 322 +- .../src/static/js/access-filter.js | 220 +- .../src/static/js/example-run.js | 69 +- .../src/static/js/google-analytics.js | 50 +- .../src/static/js/lunr-search.js | 741 +- .../src/static/js/prism-copy-to-clipboard.js | 150 +- .../src/static/js/prism-line-numbers.js | 158 +- .../src/static/js/prism-toolbar.js | 269 +- .../JSDocTemplate/src/static/js/symbols.js | 129 +- .../src/static/js/table-of-contents.js | 729 +- __DOCS__/JSDocTemplate/src/tmpl/doclet.hbs | 6 +- __DOCS__/JSDocTemplate/src/tmpl/global.hbs | 9 +- __DOCS__/JSDocTemplate/src/tmpl/readme.hbs | 20 +- .../JSDocTemplate/src/tmpl/search/_modal.hbs | 99 +- .../src/tmpl/search/_navbar-input.hbs | 22 +- .../JSDocTemplate/src/tmpl/symbol/_page.hbs | 4 +- .../src/tmpl/symbol/_tutorial.hbs | 18 +- .../src/tmpl/tag/_description.hbs | 16 +- .../JSDocTemplate/src/tmpl/tag/_details.hbs | 506 +- .../JSDocTemplate/src/tmpl/tag/_example.hbs | 39 +- .../src/tmpl/tag/_exceptions.hbs | 26 +- .../JSDocTemplate/src/tmpl/tag/_fires.hbs | 26 +- .../JSDocTemplate/src/tmpl/tag/_requires.hbs | 26 +- .../JSDocTemplate/src/tmpl/tag/_returns.hbs | 26 +- __DOCS__/JSDocTemplate/src/tmpl/tutorial.hbs | 40 +- .../JSDocTemplate/src/utils/docletHelper.js | 850 +- .../src/utils/handlebarsHelper.js | 199 +- .../JSDocTemplate/src/utils/lunrHelper.js | 190 +- .../JSDocTemplate/src/utils/postProcessor.js | 714 +- __DOCS__/JSDocTemplate/src/utils/template.js | 564 +- __DOCS__/JSDocTemplate/template/conf.json | 70 +- __DOCS__/JSDocTemplate/template/publish.js | 12 +- .../template/static/css/bootstrap.min.css | 6969 +++++++++++++++- .../template/static/css/prism.css | 118 +- .../template/static/css/prism.min.css | 166 +- .../template/static/css/template.min.css | 538 +- .../template/static/js/bootstrap.min.js | 1506 +++- .../template/static/js/clipboard.min.js | 550 +- .../template/static/js/jquery.min.js | 4659 ++++++++++- .../template/static/js/lunr.min.js | 752 +- .../JSDocTemplate/template/static/js/prism.js | 3657 ++++----- .../template/static/js/prism.min.js | 145 +- .../template/static/js/template.min.js | 526 +- __DOCS__/JSDocTemplate/template/tmpl.js | 5750 +++++++++++--- .../template/utils/docletHelper.js | 850 +- .../template/utils/handlebarsHelper.js | 199 +- .../template/utils/lunrHelper.js | 190 +- .../template/utils/postProcessor.js | 714 +- .../JSDocTemplate/template/utils/template.js | 564 +- .../JSDocTemplate/test-src/collapse.conf.json | 26 +- .../JSDocTemplate/test-src/default.conf.json | 22 +- .../test-src/fixtures/base/chains.js | 140 +- .../test-src/fixtures/base/index.js | 149 +- .../test-src/fixtures/documents/binder.js | 359 +- .../test-src/fixtures/documents/collector.js | 982 ++- .../test-src/fixtures/documents/model.js | 237 +- .../test-src/fixtures/documents/probe.js | 2025 +++-- .../test-src/fixtures/documents/schema.js | 593 +- .../test-src/fixtures/mixins/bussable.js | 205 +- .../test-src/fixtures/mixins/signalable.js | 496 +- .../test-src/fixtures/strings/format.js | 61 +- .../fixtures/tutorials/brush-teeth.md | 52 +- .../test-src/fixtures/tutorials/drive-car.md | 21 +- .../test-src/fixtures/tutorials/fence-test.md | 133 +- .../fixtures/tutorials/tutorials.json | 34 +- .../test-src/fixtures/utils/logger.js | 181 +- .../JSDocTemplate/test-src/inline.conf.json | 26 +- .../test-src/logo-color.conf.json | 30 +- .../test-src/namespaced/CustomError.js | 26 +- .../test-src/namespaced/GlobalClass.js | 133 +- .../test-src/namespaced/MyApi.js | 330 +- .../test-src/namespaced/MyApi.utils.js | 40 +- .../annotatedExamples/annotatedExamples.md | 1 - .../annotatedExamples/configuration.md | 14 +- .../annotatedExamples/imageOverlay.md | 41 +- __DOCS__/examples/annotatedExamples/resize.md | 21 +- __DOCS__/examples/annotatedExamples/rotate.md | 23 +- .../examples/gettingStarted/helloworld.md | 26 +- .../examples/gettingStarted/terminology.md | 34 +- .../examples/gettingStarted/treeShaking.md | 30 +- __DOCS__/examples/tutorials.json | 18 +- __DOCS__/resources/customStyles.css | 102 +- __TESTS_BUNDLE_SIZE__/bin/bin.ts | 3 - __TESTS_BUNDLE_SIZE__/bundleSizeTestCases.ts | 52 +- __TESTS_BUNDLE_SIZE__/bundleSizeTestRunner.ts | 17 +- __TESTS_BUNDLE_SIZE__/interfaces/ITestCase.ts | 10 +- __TESTS_BUNDLE_SIZE__/utils/consts.ts | 2 +- .../utils/fileSystem/createDistFolder.ts | 11 +- .../utils/fileSystem/createEntryFile.ts | 4 +- .../utils/fileSystem/createTestFolders.ts | 11 +- .../utils/fileSystem/getBundleInfo.ts | 2 +- .../utils/fileSystem/testCleanUp.ts | 6 +- __TESTS_BUNDLE_SIZE__/utils/log.ts | 8 +- .../utils/stringGenerators/importFromDist.ts | 2 - .../stringGenerators/importFromPackage.ts | 4 +- .../utils/testLifeCycle/handleTestSuccess.ts | 4 +- .../utils/webpack/buildWithWebpack.ts | 43 +- __TESTS__/TestUtils/createEntryMockedFS.ts | 10 +- .../transformations/sampleEmptyTextStyle.ts | 7 +- .../transformations/sampleFacePosition.ts | 8 +- .../transformations/sampleTextStyle.ts | 22 +- .../transformations/sampleTxResizePad.ts | 6 +- .../generateTransformationString.test.ts | 111 +- .../legacyExpression.test.ts | 65 +- __TESTS__/unit/Action/Action.test.ts | 120 +- __TESTS__/unit/Action/Flag.test.ts | 16 +- __TESTS__/unit/Action/Qualifier.ts | 20 +- __TESTS__/unit/Action/QualifierValue.test.ts | 17 +- __TESTS__/unit/actions/Adjust.test.ts | 207 +- __TESTS__/unit/actions/Animated.test.ts | 14 +- __TESTS__/unit/actions/Background.test.ts | 172 +- __TESTS__/unit/actions/Blur/Blur.test.ts | 49 +- __TESTS__/unit/actions/Border.test.ts | 50 +- __TESTS__/unit/actions/Conditional.test.ts | 34 +- __TESTS__/unit/actions/CustomFunction.test.ts | 28 +- __TESTS__/unit/actions/Delivery.test.ts | 356 +- __TESTS__/unit/actions/Effect.test.ts | 374 +- __TESTS__/unit/actions/Extract.test.ts | 57 +- __TESTS__/unit/actions/Flag.test.ts | 107 +- .../unit/actions/NamedTransformation.test.ts | 31 +- __TESTS__/unit/actions/Overlay.test.ts | 228 +- __TESTS__/unit/actions/PSDTools.test.ts | 91 +- .../unit/actions/Pixelate/Pixelate.test.ts | 49 +- __TESTS__/unit/actions/Quality.test.ts | 97 +- __TESTS__/unit/actions/Reshape.test.ts | 81 +- __TESTS__/unit/actions/Resize.test.ts | 34 +- .../unit/actions/Resize/AspectRatio.test.ts | 51 +- .../unit/actions/Resize/CropAction.test.ts | 56 +- .../unit/actions/Resize/FillAction.test.ts | 39 +- .../unit/actions/Resize/FillPadAction.test.ts | 40 +- .../unit/actions/Resize/FitAction.test.ts | 21 +- .../actions/Resize/ImaggaCropAction.test.ts | 24 +- .../actions/Resize/ImaggaScaleAction.test.ts | 21 +- .../actions/Resize/LimitFillAction.test.ts | 41 +- .../actions/Resize/LimitFitAction.test.ts | 19 +- .../actions/Resize/LimitPadAction.test.ts | 41 +- .../actions/Resize/MinimumFitAction.test.ts | 19 +- .../actions/Resize/MinimumPadAction.test.ts | 41 +- .../unit/actions/Resize/PadAction.test.ts | 41 +- .../unit/actions/Resize/ScaleAction.test.ts | 23 +- .../unit/actions/Resize/ThumbAction.test.ts | 28 +- __TESTS__/unit/actions/Rotate.test.ts | 21 +- __TESTS__/unit/actions/RoundCorners.test.ts | 59 +- __TESTS__/unit/actions/Transcode.test.ts | 212 +- __TESTS__/unit/actions/Variable.test.ts | 194 +- __TESTS__/unit/actions/VideoEdit.test.ts | 130 +- __TESTS__/unit/expression.test.ts | 69 +- .../unit/fromJson/adjust.fromJson.test.ts | 46 +- .../backgroundRemoval.fromJson.test.ts | 51 +- .../unit/fromJson/border.fromJson.test.ts | 34 +- .../fromJson/concatenate.fromJson.test.ts | 97 +- .../unit/fromJson/condition.fromJson.test.ts | 42 +- .../unit/fromJson/delivery.fromJson.test.ts | 370 +- .../unit/fromJson/effect.fromJson.test.ts | 171 +- __TESTS__/unit/fromJson/fromJson.test.ts | 22 +- .../fromJson/overlayUnderlay.fromJson.test.ts | 219 +- .../unit/fromJson/preview.fromJson.test.ts | 16 +- .../unit/fromJson/resize.fromJson.test.ts | 351 +- .../unit/fromJson/rotate.fromJson.test.ts | 26 +- .../fromJson/roundCorners.fromJson.test.ts | 33 +- .../unit/fromJson/transcode.fromJson.test.ts | 78 +- .../fromJson/videoEditTrim.fromJson.test.ts | 32 +- .../unit/fromJson/volume.fromJson.test.ts | 40 +- __TESTS__/unit/index.test.ts | 10 +- .../unit/scripts/createEntryPoints.test.ts | 33 +- .../unit/scripts/validatePackageFiles.test.ts | 96 +- __TESTS__/unit/toJson/adjust.toJson.test.ts | 141 +- .../toJson/backgroundRemoval.toJson.test.ts | 71 +- __TESTS__/unit/toJson/border.toJson.test.ts | 46 +- .../unit/toJson/concatenate.toJson.test.ts | 91 +- .../unit/toJson/conditional.toJson.test.ts | 46 +- __TESTS__/unit/toJson/delivery.toJson.test.ts | 187 +- __TESTS__/unit/toJson/effect.toJson.test.ts | 356 +- .../toJson/generativeRemove.toJson.test.ts | 10 +- .../toJson/overlayUnderlay.toJson.test.ts | 327 +- __TESTS__/unit/toJson/preview.toJson.test.ts | 25 +- __TESTS__/unit/toJson/resize.toJson.test.ts | 474 +- __TESTS__/unit/toJson/rotate.toJson.test.ts | 19 +- .../unit/toJson/roundCorners.toJson.test.ts | 24 +- __TESTS__/unit/toJson/toJson.test.ts | 22 +- .../unit/toJson/transcode.toJson.test.ts | 197 +- .../unit/toJson/videoEditTrim.toJson.test.ts | 49 +- __TESTS__/unit/toJson/volume.toJson.test.ts | 60 +- .../ImageTransformation.test.ts | 7 +- .../VideoTransformation.test.ts | 6 +- .../transformation/transformation.test.ts | 22 +- __TESTS__/unit/types/BlendMode.test.ts | 21 +- __TESTS__/unit/types/Position.test.ts | 46 +- .../unit/utils/base64Encode.browser.test.ts | 18 +- .../unit/utils/base64Encode.node.test.ts | 17 +- .../utils/dataStructureUtils/isString.test.ts | 12 +- .../dataStructureUtils/sortMapByKey.test.ts | 14 +- __TESTS__/unit/utils/toFloatAsString.test.ts | 50 +- .../unit/values/TextStyle/TextStyle.test.ts | 64 +- __TESTS__/unit/values/format/Format.test.ts | 203 +- .../unit/values/gravity/AutoGravity.test.ts | 38 +- .../values/gravity/CompassGravity.test.ts | 34 +- .../values/gravity/FocusOnGravity.test.ts | 100 +- __TESTS__/unit/values/gravity/Gravity.test.ts | 20 +- __TESTS__/unit/values/valueImports.test.ts | 200 +- bundlewatch.config.js | 8 +- devTools/sanity/createTestFile.ts | 75 +- devTools/sanity/index.ts | 12 +- jest.config.json | 21 +- jsdoc.config.json | 35 +- package.json | 16 +- rollup.config.js | 47 +- rollup.dev.config.js | 30 +- scripts/createEntrypoints.ts | 6 +- scripts/errors/FoundNonRequiredFile.ts | 2 +- scripts/errors/MissingRequiredFile.ts | 2 +- scripts/injectPackageVersionToDistFiles.ts | 14 +- scripts/lib/entryPointsLib.ts | 42 +- scripts/updateCompliationTests.js | 32 +- scripts/updateInjectVersionSemver.js | 6 +- scripts/updatePackageJsonExports.ts | 67 +- scripts/validatePackageFiles.ts | 31 +- src/actions.ts | 30 +- src/actions/adjust.ts | 174 +- src/actions/adjust/By3dLutAction.ts | 4 +- src/actions/adjust/FillLightAction.ts | 20 +- src/actions/adjust/ImproveAction.ts | 32 +- src/actions/adjust/OpacityAdjustAction.ts | 16 +- src/actions/adjust/RecolorAction.ts | 17 +- src/actions/adjust/ReplaceColorAction.ts | 22 +- .../simple/ViesusCorrectAdjustAction.ts | 20 +- src/actions/animated.ts | 19 +- .../background/actions/BackgroundColor.ts | 12 +- src/actions/border.ts | 46 +- src/actions/conditional.ts | 35 +- src/actions/customFunction.ts | 16 +- .../customFunction/CustomFunctionAction.ts | 30 +- src/actions/customFunction/RemoteAction.ts | 2 +- src/actions/delivery.ts | 47 +- src/actions/delivery/DeliveryAction.ts | 38 +- .../delivery/DeliveryColorSpaceAction.ts | 24 +- .../DeliveryColorSpaceFromICCAction.ts | 20 +- src/actions/delivery/DeliveryDPRAction.ts | 19 +- src/actions/delivery/DeliveryFormatAction.ts | 38 +- src/actions/delivery/DeliveryQualityAction.ts | 31 +- src/actions/effect.ts | 4 +- src/actions/effect/AssistColorBlind.ts | 36 +- src/actions/effect/BackgroundRemoval.ts | 27 +- src/actions/effect/Cartoonify.ts | 24 +- src/actions/effect/Colorize.ts | 21 +- src/actions/effect/Dither.ts | 15 +- src/actions/effect/DropShadow.ts | 36 +- .../EffectActions/EffectActionWithBlend.ts | 4 +- .../EffectActions/EffectActionWithLevel.ts | 4 +- .../EffectActions/EffectActionWithStrength.ts | 6 +- .../EffectActions/LeveledEffectAction.ts | 16 +- .../EffectActions/SimpleEffectAction.ts | 30 +- src/actions/effect/GenerativeRemove.ts | 12 +- src/actions/effect/GradientFade.ts | 33 +- src/actions/effect/Outline.ts | 41 +- src/actions/effect/RemoveBackgroundAction.ts | 15 +- src/actions/effect/Shadow.ts | 37 +- src/actions/effect/SimulateColorBlind.ts | 24 +- src/actions/effect/StyleTransfer.ts | 40 +- src/actions/effect/Theme.ts | 23 +- src/actions/effect/Vectorize.ts | 27 +- src/actions/effect/blur/Blur.ts | 47 +- src/actions/effect/leveled/Accelerate.ts | 23 +- src/actions/effect/leveled/Blackwhite.ts | 5 +- src/actions/effect/leveled/Deshake.ts | 16 +- src/actions/effect/leveled/FadeIn.ts | 24 +- src/actions/effect/leveled/FadeOut.ts | 24 +- src/actions/effect/leveled/Loop.ts | 9 +- src/actions/effect/leveled/MakeTransparent.ts | 27 +- src/actions/effect/pixelate/Pixelate.ts | 45 +- src/actions/extract.ts | 24 +- src/actions/layer/LayerAction.ts | 96 +- src/actions/namedTransformation.ts | 9 +- .../NamedTransformationAction.ts | 10 +- src/actions/overlay.ts | 12 +- src/actions/psdTools.ts | 12 +- src/actions/psdTools/ClipAction.ts | 21 +- src/actions/psdTools/GetLayerAction.ts | 24 +- src/actions/psdTools/SmartObjectAction.ts | 16 +- src/actions/reshape.ts | 22 +- src/actions/reshape/CutByImage.ts | 25 +- src/actions/reshape/Distort.ts | 10 +- src/actions/reshape/DistortArc.ts | 9 +- src/actions/reshape/Shear.ts | 15 +- src/actions/reshape/TrimAction.ts | 13 +- src/actions/resize.ts | 90 +- src/actions/resize/ResizeAdvancedAction.ts | 20 +- src/actions/resize/ResizeCropAction.ts | 14 +- src/actions/resize/ResizeFillAction.ts | 13 +- src/actions/resize/ResizeFitAction.ts | 4 +- src/actions/resize/ResizeLimitFillAction.ts | 4 +- src/actions/resize/ResizeLimitFitAction.ts | 4 +- src/actions/resize/ResizeLimitPadAction.ts | 6 +- src/actions/resize/ResizeMinimumFitAction.ts | 4 +- src/actions/resize/ResizeMinimumPadAction.ts | 6 +- src/actions/resize/ResizePadAction.ts | 28 +- src/actions/resize/ResizeScaleAction.ts | 8 +- src/actions/resize/ResizeSimpleAction.ts | 46 +- src/actions/resize/ThumbnailAction.ts | 11 +- src/actions/rotate.ts | 14 +- src/actions/rotate/RotateAction.ts | 21 +- src/actions/roundCorners.ts | 10 +- .../roundCorners/RoundCornersAction.ts | 26 +- src/actions/transcode.ts | 46 +- src/actions/transcode/AudioCodecAction.ts | 14 +- src/actions/transcode/AudioFrequencyAction.ts | 20 +- src/actions/transcode/BitRateAction.ts | 26 +- src/actions/transcode/FPSAction.ts | 18 +- src/actions/transcode/FPSRangeAction.ts | 23 +- .../transcode/KeyframeIntervalsAction.ts | 18 +- src/actions/transcode/StreamingProfile.ts | 22 +- src/actions/transcode/ToAnimatedAction.ts | 30 +- src/actions/transcode/VideoCodecAction.ts | 43 +- src/actions/underlay.ts | 19 +- src/actions/variable.ts | 26 +- src/actions/variable/SetAction.ts | 14 +- .../variable/SetAssetReferenceAction.ts | 3 +- src/actions/variable/VariableAction.ts | 21 +- src/actions/videoEdit.ts | 26 +- src/actions/videoEdit/ConcatenateAction.ts | 58 +- src/actions/videoEdit/PreviewAction.ts | 28 +- src/actions/videoEdit/TrimAction.ts | 34 +- src/actions/videoEdit/VolumeAction.ts | 35 +- src/backwards/condition.ts | 18 +- src/backwards/configuration.ts | 54 +- src/backwards/consts.ts | 70 +- src/backwards/createCloudinaryLegacyURL.ts | 62 +- src/backwards/expression.ts | 93 +- src/backwards/generateTransformationString.ts | 115 +- src/backwards/legacyLayer/fetchlayer.ts | 12 +- src/backwards/legacyLayer/layer.ts | 19 +- src/backwards/legacyLayer/subtitleslayer.ts | 3 +- src/backwards/legacyLayer/textlayer.ts | 82 +- src/backwards/transformation.ts | 365 +- .../processCustomFunction.ts | 10 +- .../processCustomPreFunction.ts | 4 +- .../transformationProcessing/processIf.ts | 2 +- .../transformationProcessing/processLayer.ts | 25 +- .../transformationProcessing/processRadius.ts | 6 +- .../processVideoParams.ts | 6 +- src/backwards/utils/finalizeResourceType.ts | 38 +- src/backwards/utils/finalize_source.ts | 12 +- src/backwards/utils/isEmpty.ts | 6 +- src/backwards/utils/isNumberLike.ts | 4 +- src/backwards/utils/isObject.ts | 3 +- src/backwards/utils/legacyBaseUtil.ts | 34 +- .../utils/legacyNormalizeExpression.ts | 12 +- src/backwards/utils/norm_range_values.ts | 6 +- src/backwards/utils/smartEscape.ts | 10 +- src/backwards/utils/snakeCase.ts | 2 +- src/backwards/utils/splitRange.ts | 2 +- src/backwards/utils/toArray.ts | 1 - src/backwards/utils/unsigned_url_prefix.ts | 18 +- src/index.ts | 13 +- src/internal/Action.ts | 26 +- src/internal/RawAction.ts | 14 +- src/internal/fromJson.ts | 22 +- src/internal/internalConstants.ts | 134 +- src/internal/models/ActionModel.ts | 4 +- src/internal/models/IActionModel.ts | 6 +- src/internal/models/IAdjustActionModel.ts | 4 +- src/internal/models/IBaseTextSourceModel.ts | 12 +- src/internal/models/IBorderActionModel.ts | 6 +- src/internal/models/IColorModel.ts | 2 +- .../models/IConcatenateActionModel.ts | 10 +- .../models/IConditionalActionModel.ts | 6 +- src/internal/models/IDeliveryActionModel.ts | 47 +- src/internal/models/IDimensionsModel.ts | 2 +- src/internal/models/IErrorObject.ts | 6 +- src/internal/models/IFetchSourceModel.ts | 8 +- src/internal/models/IHasFromJson.ts | 8 +- src/internal/models/IImageSourceModel.ts | 6 +- src/internal/models/IOpacityActionModel.ts | 4 +- src/internal/models/IOverlayActionModel.ts | 12 +- src/internal/models/IPositionModel.ts | 6 +- src/internal/models/IPreviewActionModel.ts | 4 +- .../models/IResizeAdvancedActionModel.ts | 8 +- .../models/IResizeSimpleActionModel.ts | 8 +- src/internal/models/IRotateActionModel.ts | 6 +- .../models/IRoundCornersActionModel.ts | 6 +- src/internal/models/ISourceModel.ts | 2 +- src/internal/models/IStrokeModel.ts | 12 +- src/internal/models/ISubtitlesSourceModel.ts | 8 +- src/internal/models/ITextSourceModel.ts | 14 +- src/internal/models/ITextStyleModel.ts | 4 +- src/internal/models/ITimelinePositionModel.ts | 2 +- src/internal/models/ITranscodeActionModel.ts | 28 +- src/internal/models/ITransformationModel.ts | 4 +- src/internal/models/ITrimActionModel.ts | 4 +- src/internal/models/IVideoSourceModel.ts | 4 +- src/internal/models/IVolumeActionModel.ts | 18 +- src/internal/models/QualifierModel.ts | 4 +- src/internal/models/actionToJson.ts | 10 +- .../models/createBackgroundFromModel.ts | 48 +- src/internal/models/createBackgroundModel.ts | 90 +- src/internal/models/createGravityFromModel.ts | 31 +- src/internal/models/createGravityModel.ts | 77 +- .../models/createPositionFromModel.ts | 20 +- src/internal/models/createSourceFromModel.ts | 33 +- .../models/createTextStyleFromModel.ts | 26 +- .../models/createTimelinePositionFromModel.ts | 12 +- src/internal/models/qualifierToJson.ts | 12 +- src/internal/qualifier/Qualifier.ts | 12 +- src/internal/qualifier/QualifierValue.ts | 8 +- src/internal/utils/base64Encode.ts | 14 +- src/internal/utils/cloneDeep.ts | 240 +- src/internal/utils/dataStructureUtils.ts | 11 +- src/internal/utils/jest-ts-resolver.cjs | 4 +- src/internal/utils/objectFlip.ts | 2 +- src/internal/utils/packageVersion.ts | 6 +- src/internal/utils/prepareColor.ts | 3 +- .../utils/serializeCloudinaryCharacters.ts | 10 +- src/internal/utils/toFloatAsString.ts | 6 +- src/internal/utils/unsupportedError.ts | 4 +- src/qualifiers.ts | 62 +- src/qualifiers/FontAntialias.ts | 24 +- src/qualifiers/GradientFade.ts | 13 +- src/qualifiers/animatedFormat.ts | 19 +- .../AnimatedFormatQualifierValue.ts | 9 +- src/qualifiers/artisticFilter.ts | 50 +- src/qualifiers/aspectRatio.ts | 25 +- .../aspectRatio/AspectRatioQualifierValue.ts | 2 +- src/qualifiers/audioCodec.ts | 24 +- src/qualifiers/audioFrequency.ts | 12 +- src/qualifiers/autoFocus.ts | 11 +- src/qualifiers/background.ts | 38 +- .../BackgroundGenerativeFillQualifier.ts | 24 +- .../shared/BlurredBackgroundAction.ts | 16 +- .../auto/BackgroundAutoBorderQualifier.ts | 10 +- .../BackgroundAutoPredominantQualifier.ts | 10 +- .../shared/base/BackgroundQualifier.ts | 6 +- .../shared/base/BaseCommonBackground.ts | 8 +- .../shared/base/BaseGradientBackground.ts | 10 +- .../BackgroundBorderGradientQualifier.ts | 14 +- .../BackgroundPredominantGradientQualifier.ts | 14 +- src/qualifiers/blendMode.ts | 39 +- .../blendMode/BlendModeQualifier.ts | 13 +- src/qualifiers/chromaSubSampling.ts | 17 +- src/qualifiers/color.ts | 1344 ++-- src/qualifiers/colorSpace.ts | 33 +- src/qualifiers/compass.ts | 48 +- src/qualifiers/concatenate.ts | 14 +- src/qualifiers/dither.ts | 7 +- src/qualifiers/dpr.ts | 6 +- src/qualifiers/expression.ts | 35 +- .../expression/ExpressionQualifier.ts | 4 +- src/qualifiers/flag.ts | 210 +- src/qualifiers/flag/FlagQualifier.ts | 25 +- src/qualifiers/focusOn.ts | 74 +- src/qualifiers/fontHinting.ts | 19 +- src/qualifiers/fontStyle.ts | 13 +- src/qualifiers/fontWeight.ts | 19 +- src/qualifiers/foregroundObject.ts | 42 +- src/qualifiers/format.ts | 399 +- src/qualifiers/format/FormatQualifier.ts | 6 +- src/qualifiers/gradientDirection.ts | 23 +- .../GradientDirectionQualifierValue.ts | 8 +- src/qualifiers/gravity.ts | 26 +- src/qualifiers/gravity/GravityQualifier.ts | 24 +- .../gravity/autoGravity/AutoGravity.ts | 9 +- .../gravity/compassGravity/CompassGravity.ts | 19 +- .../gravity/focusOnGravity/FocusOnGravity.ts | 8 +- .../qualifiers/compass/CompassQualifier.ts | 6 +- .../qualifiers/focusOn/FocusOnValue.ts | 5 +- .../xyCenterGravity/XYCenterGravity.ts | 7 +- src/qualifiers/improveMode.ts | 12 +- src/qualifiers/outlineMode.ts | 18 +- src/qualifiers/position.ts | 7 +- src/qualifiers/position/PositionQualifier.ts | 26 +- src/qualifiers/progressive.ts | 28 +- src/qualifiers/quality.ts | 45 +- src/qualifiers/region.ts | 10 +- src/qualifiers/region/CustomRegion.ts | 16 +- src/qualifiers/region/NamedRegion.ts | 9 +- .../rotate/RotationModeQualifierValue.ts | 5 +- src/qualifiers/rotationMode.ts | 24 +- src/qualifiers/shakeStrength.ts | 10 +- src/qualifiers/simulateColorBlind.ts | 21 +- src/qualifiers/source.ts | 18 +- src/qualifiers/source/BaseSource.ts | 17 +- .../source/sourceTypes/BaseTextSource.ts | 53 +- .../source/sourceTypes/FetchSource.ts | 24 +- .../source/sourceTypes/ImageSource.ts | 22 +- .../source/sourceTypes/SubtitlesSource.ts | 21 +- .../source/sourceTypes/TextSource.ts | 24 +- .../source/sourceTypes/VideoSource.ts | 14 +- src/qualifiers/streamingProfile.ts | 38 +- src/qualifiers/textAlignment.ts | 24 +- src/qualifiers/textDecoration.ts | 15 +- src/qualifiers/textFit.ts | 12 +- src/qualifiers/textStroke.ts | 11 +- src/qualifiers/textStyle.ts | 42 +- src/qualifiers/timeline.ts | 9 +- src/qualifiers/transition.ts | 8 +- src/qualifiers/video/TimelinePosition.ts | 19 +- src/qualifiers/videoCodec.ts | 37 +- src/qualifiers/videoCodecLevel.ts | 47 +- src/qualifiers/videoCodecProfile.ts | 22 +- .../videoCodecType/VideoCodecType.ts | 18 +- src/qualifiers/volume.ts | 12 +- src/simpleTypes.ts | 2 +- src/transformation/ImageTransformation.ts | 8 +- src/transformation/Transformation.ts | 72 +- src/transformation/VideoTransformation.ts | 7 +- src/types/types.ts | 344 +- template.min.js | 486 +- testApps/testImportAndRequire/README.md | 7 +- testApps/testImportAndRequire/testImport.mjs | 10 +- testApps/testImportAndRequire/testRequire.js | 10 +- tsconfig.json | 4 +- tsconfig.test.json | 6 +- 568 files changed, 68770 insertions(+), 30543 deletions(-) create mode 100755 .husky/pre-commit create mode 100644 .prettierrc.json diff --git a/.code-generation/config.js b/.code-generation/config.js index 86ef8fe..a4acad4 100644 --- a/.code-generation/config.js +++ b/.code-generation/config.js @@ -1,81 +1,100 @@ module.exports = { - "SDKSpecVersion": "master", - "langConfig": { - newInstanceSyntax: 'new #name(#req)#optional', - lang: 'Javascript', - methodDelimiter: '.', - groupDelimiter: '.', - openQualifiersChar: '', - closeQualifiersChar: '', - closeTransformationChar: '', + SDKSpecVersion: "master", + langConfig: { + newInstanceSyntax: "new #name(#req)#optional", + lang: "Javascript", + methodDelimiter: ".", + groupDelimiter: ".", + openQualifiersChar: "", + closeQualifiersChar: "", + closeTransformationChar: "", hideActionGroups: true, - useSimpleQualifierValuesForGroups: ['Compass','AudioCodec','AnimatedFormat','ArtisticFilter','blendMode','Flag','FontStyle','FontAntialias','FontWeight','FontHinting','textAlignment','textDecoration', 'GradientDirection','ImproveMode','OutlineMode','Progressive','SimulateColorBlind','StreamingProfile'], + useSimpleQualifierValuesForGroups: [ + "Compass", + "AudioCodec", + "AnimatedFormat", + "ArtisticFilter", + "blendMode", + "Flag", + "FontStyle", + "FontAntialias", + "FontWeight", + "FontHinting", + "textAlignment", + "textDecoration", + "GradientDirection", + "ImproveMode", + "OutlineMode", + "Progressive", + "SimulateColorBlind", + "StreamingProfile", + ], mainTransformationString: { openSyntaxString: { - image: 'new CloudinaryImage(\'#publicID\')', - video: 'new CloudinaryVideo(\'#publicID\')', - media: 'new CloudinaryMedia(\'#publicID\')' + image: "new CloudinaryImage('#publicID')", + video: "new CloudinaryVideo('#publicID')", + media: "new CloudinaryMedia('#publicID')", }, - closeSyntaxString: ';' + closeSyntaxString: ";", }, - openActionChar: '(', - closeActionChar: ')', - overwritePreset: 'javascript', - arraySeparator: ', ', - arrayOpen: '[', - arrayClose: ']', + openActionChar: "(", + closeActionChar: ")", + overwritePreset: "javascript", + arraySeparator: ", ", + arrayOpen: "[", + arrayClose: "]", prettier: { - parser: 'babel' + parser: "babel", }, formats: { - formatClassOrEnum: 'PascalCase', - formatMethod: 'camelCase', + formatClassOrEnum: "PascalCase", + formatMethod: "camelCase", formatFloat: (f) => { - if (!f.toString().includes('.')) { - return `'${f}.0'` // In JS world, 1.0 is 1, so we make sure 1.0 stays 1.0 + if (!f.toString().includes(".")) { + return `'${f}.0'`; // In JS world, 1.0 is 1, so we make sure 1.0 stays 1.0 } else { return f; } - } + }, }, methodNameMap: { - 'delivery_type': 'set_delivery_type', - 'asset_type': 'set_asset_type', - 'deliveryType': 'set_delivery_type', - 'assetType': 'set_asset_type', - 'signature': 'setSignature', + delivery_type: "set_delivery_type", + asset_type: "set_asset_type", + deliveryType: "set_delivery_type", + assetType: "set_asset_type", + signature: "setSignature", }, - canGenerateSignature:false, + canGenerateSignature: false, classNameMap: {}, childTransformations: { image: { open: "new ImageTransformation()", - close: '', + close: "", }, video: { open: "new VideoTransformation()", - close: '', + close: "", }, media: { open: "new Transformation()", - close: '', - } + close: "", + }, }, - unsupportedTxParams: ['fl_waveform', 'fl_animated', 'e_tint', 'e_theme', 'af_'], - unsupportedSyntaxList: ['.stroke(', '.textFit(', 'Animated.edit', '.RoundCorners(', 'getVideoFrame', '.transcode('] + unsupportedTxParams: ["fl_waveform", "fl_animated", "e_tint", "e_theme", "af_"], + unsupportedSyntaxList: [".stroke(", ".textFit(", "Animated.edit", ".RoundCorners(", "getVideoFrame", ".transcode("], }, - "overwrites": { + overwrites: { qualifiers: { // colorOverride is a qualifier of Reshape.trim action. color_override: (payload) => { - const {qualifierDTO} = payload; + const { qualifierDTO } = payload; const colorName = qualifierDTO.qualifiers[0].name; // TODO this should be streamlined with how we deal with color. - return `.colorOverride("${colorName}")` + return `.colorOverride("${colorName}")`; }, color: (payload) => { - const {qualifierDTO} = payload; + const { qualifierDTO } = payload; // This case supports three types of qualifiers // TODO this DTO structure needs to be aligned // {name:color, is_required:true qualifiers: [{group:'color', name: 'red', is_required:true}]} @@ -83,14 +102,14 @@ module.exports = { // {group:'color', name: 'rgb', qualifiers: [{ "name": "color", "value": "#d5d2ca", "is_required": true, "value_type": "string" }]} let colorName; - if (qualifierDTO.qualifiers && qualifierDTO.name === 'rgb') { + if (qualifierDTO.qualifiers && qualifierDTO.name === "rgb") { colorName = qualifierDTO.qualifiers[0].value; } else { colorName = qualifierDTO.qualifiers ? qualifierDTO.qualifiers[0].name : qualifierDTO.name; } return `'${colorName}'`; - } - } - } -} + }, + }, + }, +}; diff --git a/.eslintrc b/.eslintrc index 202c7e8..b9177ce 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,14 +1,8 @@ { "root": true, "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint", - "import" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended" - ], + "plugins": ["@typescript-eslint", "import"], + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], "parserOptions": { "ecmaVersion": 2018, "sourceType": "module" @@ -21,25 +15,28 @@ "rules": { "require-jsdoc": "error", "no-unused-vars": "warn", - "indent" : ["error", 2, { "SwitchCase": 1 }], - "dot-notation" : "error", - "no-param-reassign" : "error", - "no-unreachable" : "error", - "arrow-parens" : "error", - "one-var-declaration-per-line" : "error", + "indent": ["error", 2, { "SwitchCase": 1 }], + "dot-notation": "error", + "no-param-reassign": "error", + "no-unreachable": "error", + "arrow-parens": "error", + "one-var-declaration-per-line": "error", "curly": "error", "semi": "error", "prefer-const": "error", - "vars-on-top" : "error", + "vars-on-top": "error", "no-cond-assign": "error", - "@typescript-eslint/ban-ts-comment" : "warn", - "comma-spacing" : "error", - "no-multi-spaces" : "error", - "prefer-template" : "error", + "@typescript-eslint/ban-ts-comment": "warn", + "comma-spacing": "error", + "no-multi-spaces": "error", + "prefer-template": "error", "import/extensions": [2, "ignorePackages"], - "max-nested-callbacks" : ["error",{ - "max": 3 - }], + "max-nested-callbacks": [ + "error", + { + "max": 3 + } + ], "@typescript-eslint/no-empty-interface": 0, "@typescript-eslint/no-empty-function": 0 } diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 02fe5aa..82a7341 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,10 +1,10 @@ ### Pull request for @cloudinary/transformation-builder-sdk - #### What does this PR solve? -... A few words +... A few words #### Final checklist + - [ ] Implementation is aligned to Spec. - [ ] Tests - Add proper tests to the added code. diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..d24fdfc --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..963354f --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "printWidth": 120 +} diff --git a/.release-it.json b/.release-it.json index c076ccb..29c1038 100644 --- a/.release-it.json +++ b/.release-it.json @@ -4,7 +4,7 @@ "out": ["package.json", "../package.json"] } }, - "hooks" :{ - "after:bump" : "git add .. -u" + "hooks": { + "after:bump": "git add .. -u" } } diff --git a/CHANGELOG.md b/CHANGELOG.md index e5efa8e..227018f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,73 +1,58 @@ -1.2.10 / 2023-07-11 -================== +# 1.2.10 / 2023-07-11 - Add support for Generative Fill background - Adjust allowed Background Removal hints syntax -1.2.9 / 2023-06-06 -================== + # 1.2.9 / 2023-06-06 - Default value for background removal fine edges option -1.2.8 / 2023-05-04 -================== + # 1.2.8 / 2023-05-04 - Return nested transformation errors at the layer action level -1.2.7 / 2023-03-08 -================== + # 1.2.7 / 2023-03-08 - Add missing focusOn named export -1.2.6 / 2023-02-22 -================== + # 1.2.6 / 2023-02-22 -- Border actionModel params compliant with transformation-model +- Border actionModel params compliant with transformation-model -1.2.5 / 2023-02-21 -================== + # 1.2.5 / 2023-02-21 -- Adjust border radius in from/toJson model +- Adjust border radius in from/toJson model -1.2.4 / 2023-02-20 -================== + # 1.2.4 / 2023-02-20 - Align RoundCorners action with the specs -1.2.3 / 2023-02-03 -================== + # 1.2.3 / 2023-02-03 - Add fromJson support to Opacity action -1.2.2 / 2023-02-03 -================== + # 1.2.2 / 2023-02-03 - Fix opacity action (missing actionModel) -1.2.1 / 2023-01-31 -================== + # 1.2.1 / 2023-01-31 - Updated default values of Drop Shadow action -1.2.0 / 2023-01-11 -================== + # 1.2.0 / 2023-01-11 - Add DropShadow effect -1.1.0 / 2022-10-20 -================== + # 1.1.0 / 2022-10-20 - * Add Background Removal effect - * Add from/toJson for rotateByAngle Action + - Add Background Removal effect + - Add from/toJson for rotateByAngle Action -1.0.1 / 2022-09-13 -================== + # 1.0.1 / 2022-09-13 - * Fix broken prettier version - * Default length for the fade action + - Fix broken prettier version + - Default length for the fade action -1.0.0 / 2022-05-12 -================== + # 1.0.0 / 2022-05-12 Release package - diff --git a/README.md b/README.md index 47a4dc2..fe264bd 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,84 @@ -Cloudinary JS-Transformation-Builder-SDK -========================= +# Cloudinary JS-Transformation-Builder-SDK + [![Build Status](https://api.travis-ci.com/cloudinary/js-transformation-builder-sdk.svg?branch=master)](https://app.travis-ci.com/github/cloudinary/js-url-gen) + ## About + This is an internal Cloudinary SDK. The Cloudinary JS-Transformation-Builder-SDK allows you to generate transformations for `@cloudinary/url-gen` ### Additional documentation + This Readme provides basic installation and usage information. ## Table of Contents + - [Key Features](#key-features) - [Version Support](#Version-Support) - [Installation](#installation) - [Usage](#usage) - - [Setup](#Setup) - - [Transform and Optimize Assets](#Transform-and-Optimize-Assets) - - [Transpilation](#Transpilation) - - [Testing with Jest](#Testing-with-jest) + - [Setup](#Setup) + - [Transform and Optimize Assets](#Transform-and-Optimize-Assets) + - [Transpilation](#Transpilation) + - [Testing with Jest](#Testing-with-jest) - [Contributions](#Contributions) - [Get Help](#Get-Help) - [Additional Resources](#Additional-Resources) ## Key Features + - [Transform image](https://cloudinary.com/documentation/javascript_image_transformations) assets (links to docs). - [Transform video](https://cloudinary.com/documentation/javascript_video_transformations) assets (links to docs). - ## Version Support ### Note! -This SDK is cross-platform, but only the Node.js versions are worth mentioning - -| SDK Version | Node.js 10 | Node.js 12 | Node.js 14 | Node.js 16 | -|---------------|------------|----------|----------|----------| -| 1.x | V | V | V | V | +This SDK is cross-platform, but only the Node.js versions are worth mentioning +| SDK Version | Node.js 10 | Node.js 12 | Node.js 14 | Node.js 16 | +| ----------- | ---------- | ---------- | ---------- | ---------- | +| 1.x | V | V | V | V | ## Installation + ### Install using your favorite package manager (yarn, npm) + ```bash npm install @cloudinary/transformation-builder-sdk ``` + ```bash yarn add @cloudinary/transformation-builder-sdk ``` ## Usage + ### Setup + ```javascript // Import the Cloudinary class -import {Transformation} from '@cloudinary/transformation-builder-sdk'; +import { Transformation } from "@cloudinary/transformation-builder-sdk"; // Create your transformation -const tx = new Transformation() - .resize(scale(100, 100)) +const tx = new Transformation().resize(scale(100, 100)); ``` ### Transform and Optimize Assets + - [See full documentation](https://cloudinary.com/documentation/javascript_image_transformations) + ```javascript // Create a new instance if you haven't (see above for the details) -const cld = new Cloudinary({/*...*/}) +const cld = new Cloudinary({ + /*...*/ +}); // Let's create a new image -const myImage = cld.image('sample'); +const myImage = cld.image("sample"); // Import the resize transformation and apply it to myImage -import {Resize} from '@cloudinary/url-gen/actions/resize'; +import { Resize } from "@cloudinary/url-gen/actions/resize"; // Resize the image to 100x100 myImage.resize(Resize.scale().width(100).height(100)); @@ -80,15 +91,18 @@ console.log(myURL); ``` ### Transpilation + `@cloudinary/transformation-builder-sdk` is shipped as untranspiled ES6 code. `@cloudinary/transformation-builder-sdk` is optimized around bundle size, as such we do not transpile our distributed modules, we leave the decision of what browsers to support, and what transpilations to apply, to you, the user. ### Testing with Jest + As mentioned above, we're shipping `@cloudinary/transformation-builder-sdk` with ES6 code, as this provides great tree-shaking potential. it also requires a few adjustments when testing. In jest.config, you'll need to add these lines to allow babel to transpile our code. + ```json { "transform": { @@ -97,22 +111,23 @@ In jest.config, you'll need to add these lines to allow babel to transpile our c "transformIgnorePatterns": ["/node_modules/(?!@cloudinary/transformation-builder-sdk)"] } ``` + Make sure to install babel-jest: `npm install babel-jest` You'll also need to ensure you have a `babel.config.js` file (and not a `.babelrc`), and that it's configured properly to transpile code, -*As an example*: +_As an example_: + ```js module.exports = { - "presets": [ - "@babel/preset-env" - ] + presets: ["@babel/preset-env"], }; ``` ## Contributions + - Clone this repository - Create a fork - Make your changes @@ -121,17 +136,19 @@ module.exports = { - Push your changes - Await a review from the maintainers - ## Get Help + If you run into an issue or have a question, you can either: + - [Open a Github issue](https://github.com/cloudinary/transformation-builder-sdk/issues) (for issues related to the SDK) - [Open a support ticket](https://cloudinary.com/contact) (for issues related to your account) ## About Cloudinary -Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive and personalized visual-media experiences—irrespective of the viewing device. +Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive and personalized visual-media experiences—irrespective of the viewing device. ## Additional Resources + - [React SDK](https://www.npmjs.com/package/@cloudinary/react) - [Angular SDK](https://www.npmjs.com/package/@cloudinary/angular) - [Use with a Frontend Framework](https://cloudinary.com/documentation/sdks/js/frontend-frameworks/index.html) @@ -145,6 +162,6 @@ Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinar - [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration. - [Cloudinary Website](https://cloudinary.com) - ## Licence + Released under the MIT license. diff --git a/__DOCS__/JSDocTemplate/.test/CustomError.html b/__DOCS__/JSDocTemplate/.test/CustomError.html index e59a504..b4c0c44 100644 --- a/__DOCS__/JSDocTemplate/.test/CustomError.html +++ b/__DOCS__/JSDocTemplate/.test/CustomError.html @@ -1,203 +1,287 @@ - - - - - - CustomError - - - - - - - - - - - -
-
-
- -
-
-
-

new CustomError( message )

-

A global custom error.

-
-
-
Description

As this is just a test file there is no implementation of inheriting the Error.prototype or fixing of the stack trace, this is a dummy dummy object to test the documentation.

-
-
Parameters
- - - - - - - - - - - - - - - -
NameTypeDescription
messagestring -

The message for the error.

-
-
-
Examples

Use this class like any standard error object.

-
-

throw new CustomError("Oh no! It broke :(");
-
-
Details
- - - - -
- -
-

Error

-
-
- - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + CustomError + + + + + + + + + + + + +
+
+
+ +
+
+
+

+ new CustomError( message ) +

+

A global custom error.

+
+
+
+
+
Description
+
+

+ As this is just a test file there is no implementation of inheriting the Error.prototype or + fixing of the stack trace, this is a dummy dummy object to test the documentation. +

+
+
+
+
Parameters
+ + + + + + + + + + + + + + + +
NameTypeDescription
messagestring +

The message for the error.

+
+
+
+
Examples
+
+

Use this class like any standard error object.

+
+
+

+throw new CustomError("Oh no! It broke :(");
+
+
+
+
Details
+
+ +
+ +
+

Error

+
+
+ + +
+ +
+

+ CustomError.js, + line 1 +

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/CustomError.js.html b/__DOCS__/JSDocTemplate/.test/CustomError.js.html index 378bc1d..0cc9ffb 100644 --- a/__DOCS__/JSDocTemplate/.test/CustomError.js.html +++ b/__DOCS__/JSDocTemplate/.test/CustomError.js.html @@ -1,139 +1,216 @@ - - - - - - - CustomError.js - - - - - - - - - - - -
-
-
-
-
-
/**
- * @summary A global custom error.
- * @constructor CustomError
- * @param {string} message - The message for the error.
- * @description As this is just a test file there is no implementation of inheriting the Error.prototype or fixing of the stack trace, this is a dummy dummy object to test the documentation.
- * @extends {Error} The default `Error` object.
- * @example {@caption Use this class like any standard error object.}
- * throw new CustomError("Oh no! It broke :(");
- */
-function CustomError(message){
-	this.name = "CustomError";
-	this.message = message;
-}
-
-
-
-
- - - - - - - - - - - - - \ No newline at end of file + + + + + + + CustomError.js + + + + + + + + + + + + +
+
+
+
+
+
/**
+ * @summary A global custom error.
+ * @constructor CustomError
+ * @param {string} message - The message for the error.
+ * @description As this is just a test file there is no implementation of inheriting the Error.prototype or fixing of the stack trace, this is a dummy dummy object to test the documentation.
+ * @extends {Error} The default `Error` object.
+ * @example {@caption Use this class like any standard error object.}
+ * throw new CustomError("Oh no! It broke :(");
+ */
+function CustomError(message){
+	this.name = "CustomError";
+	this.message = message;
+}
+
+
+
+
+ + + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/GlobalClass.html b/__DOCS__/JSDocTemplate/.test/GlobalClass.html index a7166cc..a29c6a1 100644 --- a/__DOCS__/JSDocTemplate/.test/GlobalClass.html +++ b/__DOCS__/JSDocTemplate/.test/GlobalClass.html @@ -1,468 +1,580 @@ - - - - - - GlobalClass - - - - - - - - - - - -
-
-
- -
- - -
-
-
-
-

new GlobalClass( arg1 [, ...arg2 ] )

-

This is the summary of the global test class, test markdown.

-
-
-
Description

This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test markdown

-
-
Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
arg1string -

The first test arg, test markdown.

-
arg2string<optional>
<repeatable>
false -

A repeatable, optional argument with a default value of false, test markdown.

-
-
-
Examples

You can provide example captions with markdown and specify the language to use when rendering the code, defaults to javascript.

-
-

var gc = new GlobalClass("arg1", "arg2");
-
-
-

<head>
	<title>HTML Highlighting</title>
	<script>
	  // supports embedded languages
		var gc = new GlobalClass("arg1", "arg2");
	</script>
</head>
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

Members

-
-
-
-

name :string

-

The name of the class.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

"Test Global"

-
-
- - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

<private> _privateMember :string

-

A private member of the class.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

"Test Global"

-
-
- - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-

Methods

-
-
-
-

testMethod( value, obj [, ...objN ] ) → {Object}

-

This is a test instance method of the global test class, test markdown

-
-
-
-
Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
value* -

Any value, test markdown

-
objObject -

The first object of what could be many, test markdown

-
objNObject<optional>
<repeatable>
-

Any additional objects, test markdown

-
-
-
Returns
-
- -
-

The combination of all the objects, test markdown.

-
-
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

testMethod( type )

-

This is a test instance method of the global test class to check that global type definitions are documented.

-
-
-
-
Parameters
- - - - - - - - - - - - - - - -
NameTypeDescription
typeSomeType -

The parameter which is of type SomeType

-
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + GlobalClass + + + + + + + + + + + + +
+
+
+ +
+ + +
+
+
+
+

+ new GlobalClass( arg1 [, ...arg2 ] ) +

+
+

+ This is the summary of the global test class, test + markdown. +

+
+
+
+
+
+
Description
+
+

+ This is the description for the class this is meant to be a more in depth explanation of what + this class does and it's general use case, test markdown +

+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
arg1string +

The first test arg, test markdown.

+
arg2string<optional>
<repeatable>
false +

+ A repeatable, optional argument with a default value of false, test markdown. +

+
+
+
+
Examples
+
+

+ You can provide example captions with + markdown and specify the language to use when rendering the code, defaults to + javascript. +

+
+
+

+var gc = new GlobalClass("arg1", "arg2");
+
+
+

+<head>
+	<title>HTML Highlighting</title>
+	<script>
+	  // supports embedded languages
+		var gc = new GlobalClass("arg1", "arg2");
+	</script>
+</head>
+
+
+
+
Details
+
+ +
+ +
+

+ GlobalClass.js, + line 1 +

+
+
+
+
+
+
+
+
+

Members

+
+
+
+

+ name :string +

+

The name of the class.

+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

"Test Global"

+
+
+ + +
+ +
+

+ GlobalClass.js, + line 19 +

+
+
+
+
+
+
+
+
+

+ <private> _privateMember :string +

+
+

A private member of the class.

+
+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

"Test Global"

+
+
+ + +
+ +
+

+ GlobalClass.js, + line 27 +

+
+
+
+
+
+
+
+

Methods

+
+
+
+

+ testMethod( value, + obj [, ...objN ] ) → {Object} +

+
+

This is a test instance method of the global test class, test markdown

+
+
+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value* +

Any value, test markdown

+
objObject +

+ The first object of what could be many, test + markdown +

+
objNObject<optional>
<repeatable>
+

+ Any additional objects, test + markdown +

+
+
+
+
Returns
+
+
+ +
+
+

+ The combination of all the objects, test + markdown. +

+
+
+
+
+
+
+
Details
+
+ +
+ +
+

+ GlobalClass.js, + line 38 +

+
+
+
+
+
+
+
+
+

+ testMethod( type ) +

+
+

+ This is a test instance method of the global test class to check that global type definitions are + documented. +

+
+
+
+
+
+
Parameters
+ + + + + + + + + + + + + + + +
NameTypeDescription
type + SomeType + +

The parameter which is of type SomeType

+
+
+
+
Details
+
+ +
+ +
+

+ GlobalClass.js, + line 51 +

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/GlobalClass.js.html b/__DOCS__/JSDocTemplate/.test/GlobalClass.js.html index 8969499..29c1a08 100644 --- a/__DOCS__/JSDocTemplate/.test/GlobalClass.js.html +++ b/__DOCS__/JSDocTemplate/.test/GlobalClass.js.html @@ -1,195 +1,272 @@ - - - - - - - GlobalClass.js - - - - - - - - - - - -
-
-
-
-
-
/**
- * @summary This is the summary of the global test class, test `markdown`.
- * @constructor GlobalClass
- * @param {string} arg1 - The first test arg, test `markdown`.
- * @param {...string} [arg2=false] - A repeatable, optional argument with a default value of false, test `markdown`.
- * @description This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test `markdown`
- * @example {@caption You can provide example captions with `markdown` and specify the language to use when rendering the code, defaults to `javascript`.}
- * var gc = new GlobalClass("arg1", "arg2");
- * @example {@lang xml}
- * <head>
- * 	<title>HTML Highlighting</title>
- * 	<script>
- * 	  // supports embedded languages
- * 		var gc = new GlobalClass("arg1", "arg2");
- * 	</script>
- * </head>
- */
-function GlobalClass(arg1, arg2){
-	/**
-	 * @summary The name of the class.
-	 * @memberof GlobalClass#
-	 * @name name
-	 * @type {string}
-	 * @default "Test Global"
-	 */
-	this.name = "Test Global";
-	/**
-	 * @summary A private member of the class.
-	 * @memberof GlobalClass#
-	 * @name _privateMember
-	 * @type {string}
-	 * @private
-	 * @default "Test Global"
-	 */
-	this._privateMember = "Private Member";
-}
-
-/**
- * @summary This is a test instance method of the global test class, test `markdown`
- * @memberof GlobalClass#
- * @function testMethod
- * @param {*} value - Any value, test `markdown`
- * @param {Object} obj - The first object of what could be many, test `markdown`
- * @param {...Object} [objN] - Any additional objects, test `markdown`
- * @returns {Object} The combination of all the objects, test `markdown`.
- */
-GlobalClass.prototype.testMethod = function(value, obj, objN){
-
-};
-
-/**
- * @summary This is a test instance method of the global test class to check that global type definitions are documented.
- * @memberof GlobalClass#
- * @function testMethod
- * @param {SomeType} type - The parameter which is of type SomeType
- */
-GlobalClass.prototype.testTypeDefMethod = function(type){
-
-};
-
-window.GlobalClass = GlobalClass;
-
-
-/**
- * Some global type.
- * @global
- * @typedef {Object} SomeType
- * @property {string} someProp
- */
-
-
-
-
- - - - - - - - - - - - - \ No newline at end of file + + + + + + + GlobalClass.js + + + + + + + + + + + + +
+
+
+
+
+
/**
+ * @summary This is the summary of the global test class, test `markdown`.
+ * @constructor GlobalClass
+ * @param {string} arg1 - The first test arg, test `markdown`.
+ * @param {...string} [arg2=false] - A repeatable, optional argument with a default value of false, test `markdown`.
+ * @description This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test `markdown`
+ * @example {@caption You can provide example captions with `markdown` and specify the language to use when rendering the code, defaults to `javascript`.}
+ * var gc = new GlobalClass("arg1", "arg2");
+ * @example {@lang xml}
+ * <head>
+ * 	<title>HTML Highlighting</title>
+ * 	<script>
+ * 	  // supports embedded languages
+ * 		var gc = new GlobalClass("arg1", "arg2");
+ * 	</script>
+ * </head>
+ */
+function GlobalClass(arg1, arg2){
+	/**
+	 * @summary The name of the class.
+	 * @memberof GlobalClass#
+	 * @name name
+	 * @type {string}
+	 * @default "Test Global"
+	 */
+	this.name = "Test Global";
+	/**
+	 * @summary A private member of the class.
+	 * @memberof GlobalClass#
+	 * @name _privateMember
+	 * @type {string}
+	 * @private
+	 * @default "Test Global"
+	 */
+	this._privateMember = "Private Member";
+}
+
+/**
+ * @summary This is a test instance method of the global test class, test `markdown`
+ * @memberof GlobalClass#
+ * @function testMethod
+ * @param {*} value - Any value, test `markdown`
+ * @param {Object} obj - The first object of what could be many, test `markdown`
+ * @param {...Object} [objN] - Any additional objects, test `markdown`
+ * @returns {Object} The combination of all the objects, test `markdown`.
+ */
+GlobalClass.prototype.testMethod = function(value, obj, objN){
+
+};
+
+/**
+ * @summary This is a test instance method of the global test class to check that global type definitions are documented.
+ * @memberof GlobalClass#
+ * @function testMethod
+ * @param {SomeType} type - The parameter which is of type SomeType
+ */
+GlobalClass.prototype.testTypeDefMethod = function(type){
+
+};
+
+window.GlobalClass = GlobalClass;
+
+
+/**
+ * Some global type.
+ * @global
+ * @typedef {Object} SomeType
+ * @property {string} someProp
+ */
+
+
+
+
+ + + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/MyApi.Child.html b/__DOCS__/JSDocTemplate/.test/MyApi.Child.html index a4811e3..fec1eb5 100644 --- a/__DOCS__/JSDocTemplate/.test/MyApi.Child.html +++ b/__DOCS__/JSDocTemplate/.test/MyApi.Child.html @@ -1,645 +1,798 @@ - - - - - - MyApi.Child - - - - - - - - - - - -
-
-
- -
- - - - -
-
-
-
-

new Child()

-

This is the summary of the MyApi child class, test markdown.

-
-
-
Details
- - - - -
- - -
- - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

Members

-
-
-
-

<protected> protectedMember :string

-

I'm a protected member of the class.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

"I'm a protected member."

-
-
- - - - - - -
- - -
- - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

publicMember :string

-

I'm a member of the class.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

"I'm an instance member."

-
-
- - - - - -
- - -
- - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

<private> _privateMember :string

-

I'm a private member of the class.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

"I'm a private member."

-
-
- - - - - -
- - -
- - - - - - - - - - -
- - -
- - - - -
-
-
-
-

Methods

-
-
-
-

anotherMethod( value, obj [, ...objN ] ) → {Object}

-

This is a another test instance method of the MyApi child class, test markdown.

-
-
-
Description

This method overrides the MyApi.Class#anotherMethod and should remove the exception documentation as it no longer applies. The event should also be updated to reflect it is raised by this class and not the inherited one.

-
-
Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
value* -

Any value, test markdown

-
objObject -

The first object of what could be many, test markdown

-
objNObject<optional>
<repeatable>
-

Any additional objects, test markdown

-
-
-
Returns
-
- -
-

The combination of all the objects, test markdown.

-
-
-
-
Fires
-
- -
-

This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.

-
-
-
-
Details
- - - - - - - - -
- - -
- - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

testMethod( value, obj [, ...objN ] ) → {Object}

-

This is a test instance method of the MyApi test class, test markdown.

-
-
-
Description

This method is not overridden in the MyApi.Child class but is simply inherited.

-
-
Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
value* -

Any value, test markdown

-
objObject -

The first object of what could be many, test markdown

-
objNObject<optional>
<repeatable>
-

Any additional objects, test markdown

-
-
-
Returns
-
- -
-

The combination of all the objects, test markdown.

-
-
-
-
Fires
-
- -
-

This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.

-
-
-
-
Throws
-
- -
-

This is thrown when some condition fails within this method.

-
-
-
-
Details
- - - - - - - -
- - -
- - - - - - - - - - -
- - -
- - - - -
-
-
-
-

Events

-
-
-
-

"another.my-api"

-

This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.

-
-
-
-
Parameters
- - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eEvent -

The event object.

-
custom* -

Some custom parameter passed to any listeners.

-
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + MyApi.Child + + + + + + + + + + + + +
+
+
+ +
+ + + + +
+
+
+
+

+ new Child() +

+
+

+ This is the summary of the MyApi child class, test + markdown. +

+
+
+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.Class +

+
+
+ + +
+ +
+

+ MyApi.js, + line 128 +

+
+
+
+
+
+
+
+
+

Members

+
+
+
+

+ <protected> protectedMember :string +

+
+

I'm a protected member of the class.

+
+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

"I'm a protected member."

+
+
+ + +
+ + +
+ + +
+ +
+

+ MyApi.js, + line 135 +

+
+
+
+
+
+
+
+
+

+ publicMember :string +

+

I'm a member of the class.

+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

"I'm an instance member."

+
+
+ + +
+ + +
+ + +
+ +
+

+ MyApi.js, + line 44 +

+
+
+
+
+
+
+
+
+

+ <private> _privateMember :string +

+
+

I'm a private member of the class.

+
+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

"I'm a private member."

+
+
+ + +
+ + +
+ + +
+ +
+

+ MyApi.js, + line 61 +

+
+
+
+
+
+
+
+

Methods

+
+
+
+

+ anotherMethod( value, + obj [, ...objN ] ) → {Object} +

+
+

This is a another test instance method of the MyApi child class, test markdown.

+
+
+
+
+
+
Description
+
+

+ This method overrides the + MyApi.Class#anotherMethod + and should remove the exception documentation as it no longer applies. The event should also + be updated to reflect it is raised by this class and not the inherited one. +

+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value* +

Any value, test markdown

+
objObject +

+ The first object of what could be many, test + markdown +

+
objNObject<optional>
<repeatable>
+

+ Any additional objects, test + markdown +

+
+
+
+
Returns
+
+
+ +
+
+

+ The combination of all the objects, test + markdown. +

+
+
+
+
+
+
+
Fires
+
+
+ +
+
+

+ This is an event raised by this class, it's documentation appears on this page as the + event is specified as an inner member the class by using the tilde (~) scope. +

+
+
+
+
+
+
+
Details
+
+ +
+ + +
+ + +
+ +
+

+ MyApi.js, + line 146 +

+
+
+
+
+
+
+
+
+

+ testMethod( value, + obj [, ...objN ] ) → {Object} +

+
+

This is a test instance method of the MyApi test class, test markdown.

+
+
+
+
+
+
Description
+
+

+ This method is not overridden in the + MyApi.Child class but is simply inherited. +

+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value* +

Any value, test markdown

+
objObject +

+ The first object of what could be many, test + markdown +

+
objNObject<optional>
<repeatable>
+

+ Any additional objects, test + markdown +

+
+
+
+
Returns
+
+
+ +
+
+

+ The combination of all the objects, test + markdown. +

+
+
+
+
+
+
+
Fires
+
+
+ +
+
+

+ This is an event raised by this class, it's documentation appears on this page as the + event is specified as an inner member the class by using the tilde (~) scope. +

+
+
+
+
+
+
+
Throws
+
+
+ +
+
+

This is thrown when some condition fails within this method.

+
+
+
+
+
+
+
Details
+
+ +
+ + +
+ + +
+ +
+

+ MyApi.js, + line 72 +

+
+
+
+
+
+
+
+

Events

+
+
+
+

+ "another.my-api" +

+
+

+ This is an event raised by this class, it's documentation appears on this page as the event is + specified as an inner member the class by using the tilde (~) scope. +

+
+
+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eEvent +

The event object.

+
custom* +

Some custom parameter passed to any listeners.

+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.js, + line 158 +

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/MyApi.Class.html b/__DOCS__/JSDocTemplate/.test/MyApi.Class.html index c43d4b5..95c4a65 100644 --- a/__DOCS__/JSDocTemplate/.test/MyApi.Class.html +++ b/__DOCS__/JSDocTemplate/.test/MyApi.Class.html @@ -1,833 +1,1001 @@ - - - - - - MyApi.Class - - - - - - - - - - - -
-
-
- -
- - - -
-
-
-
-

new Class( arg1 [, ...arg2 ] )

-

This is the summary of the MyApi test class, test markdown.

-
-
-
Description

This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test markdown

-
-
Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
arg1string -

The first test arg, test markdown.

-
arg2string<optional>
<repeatable>
false -

A repeatable, optional argument with a default value of false, test markdown.

-
-
-
Examples

You can provide example captions with markdown and specify the language to use when rendering the code, defaults to javascript.

-
-

var gc = new GlobalClass("arg1", "arg2");
-
-
-

<head>
	<title>HTML Highlighting</title>
	<script>
	  // supports embedded languages
		var gc = new GlobalClass("arg1", "arg2");
	</script>
</head>
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

Members

-
-
-
-

publicMember :string

-

I'm a member of the class.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

"I'm an instance member."

-
-
- - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

<protected> protectedMember :string

-

I'm a protected member of the class.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

"I'm a protected member."

-
-
- - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

<private> _privateMember :string

-

I'm a private member of the class.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

"I'm a private member."

-
-
- - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-

Methods

-
-
-
-

testMethod( value, obj [, ...objN ] ) → {Object}

-

This is a test instance method of the MyApi test class, test markdown.

-
-
-
Description

This method is not overridden in the MyApi.Child class but is simply inherited.

-
-
Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
value* -

Any value, test markdown

-
objObject -

The first object of what could be many, test markdown

-
objNObject<optional>
<repeatable>
-

Any additional objects, test markdown

-
-
-
Returns
-
- -
-

The combination of all the objects, test markdown.

-
-
-
-
Fires
-
- -
-

This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.

-
-
-
-
Throws
-
- -
-

This is thrown when some condition fails within this method.

-
-
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

anotherMethod( value, obj [, ...objN ] ) → {Object}

-

This is a another test instance method of the MyApi test class, test markdown.

-
-
-
Description

This method is overridden in the MyApi.Child class and should remove the exception documentation as it no longer applies.

-
-
Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
value* -

Any value, test markdown

-
objObject -

The first object of what could be many, test markdown

-
objNObject<optional>
<repeatable>
-

Any additional objects, test markdown

-
-
-
Returns
-
- -
-

The combination of all the objects, test markdown.

-
-
-
-
Fires
-
- -
-

This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.

-
-
-
-
Throws
-
- -
-

This is thrown when some condition fails within this method.

-
-
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-

Type Definitions

-
-
-
-

Object

-

This is a test type definition on the MyApi.Class class.

-
-
-
-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
namestring -

The name of the test object.

-
enabledboolean<optional>
false -

Whether or not the test object is enabled. Defaults to false.

-
subObject -

An object containing a subset of properties.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
idnumber -

The subset id.

-
nameboolean<optional>
"Sub Options" -

The name of the sub object. Defaults to "Sub Options".

-
-
-
-
Details
- - -
- -
-
Object
-
-
- - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-

Events

-
-
-
-

"test.my-api"

-

This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.

-
-
-
-
Parameters
- - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eEvent -

The event object.

-
custom* -

Some custom parameter passed to any listeners.

-
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

"another.my-api"

-

This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.

-
-
-
-
Parameters
- - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
eEvent -

The event object.

-
custom* -

Some custom parameter passed to any listeners.

-
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + MyApi.Class + + + + + + + + + + + + +
+
+
+ +
+ + + +
+
+
+
+

+ new Class( arg1 [, ...arg2 ] ) +

+
+

+ This is the summary of the MyApi test class, test + markdown. +

+
+
+
+
+
+
Description
+
+

+ This is the description for the class this is meant to be a more in depth explanation of what + this class does and it's general use case, test markdown +

+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
arg1string +

The first test arg, test markdown.

+
arg2string<optional>
<repeatable>
false +

+ A repeatable, optional argument with a default value of false, test markdown. +

+
+
+
+
Examples
+
+

+ You can provide example captions with + markdown and specify the language to use when rendering the code, defaults to + javascript. +

+
+
+

+var gc = new GlobalClass("arg1", "arg2");
+
+
+

+<head>
+	<title>HTML Highlighting</title>
+	<script>
+	  // supports embedded languages
+		var gc = new GlobalClass("arg1", "arg2");
+	</script>
+</head>
+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.js, + line 25 +

+
+
+
+
+
+
+
+
+

Members

+
+
+
+

+ publicMember :string +

+

I'm a member of the class.

+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

"I'm an instance member."

+
+
+ + +
+ +
+

+ MyApi.js, + line 44 +

+
+
+
+
+
+
+
+
+

+ <protected> protectedMember :string +

+
+

I'm a protected member of the class.

+
+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

"I'm a protected member."

+
+
+ + +
+ +
+

+ MyApi.js, + line 52 +

+
+
+
+
+
+
+
+
+

+ <private> _privateMember :string +

+
+

I'm a private member of the class.

+
+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

"I'm a private member."

+
+
+ + +
+ +
+

+ MyApi.js, + line 61 +

+
+
+
+
+
+
+
+

Methods

+
+
+
+

+ testMethod( value, + obj [, ...objN ] ) → {Object} +

+
+

This is a test instance method of the MyApi test class, test markdown.

+
+
+
+
+
+
Description
+
+

+ This method is not overridden in the + MyApi.Child class but is simply inherited. +

+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value* +

Any value, test markdown

+
objObject +

+ The first object of what could be many, test + markdown +

+
objNObject<optional>
<repeatable>
+

+ Any additional objects, test + markdown +

+
+
+
+
Returns
+
+
+ +
+
+

+ The combination of all the objects, test + markdown. +

+
+
+
+
+
+
+
Fires
+
+
+ +
+
+

+ This is an event raised by this class, it's documentation appears on this page as the + event is specified as an inner member the class by using the tilde (~) scope. +

+
+
+
+
+
+
+
Throws
+
+
+ +
+
+

This is thrown when some condition fails within this method.

+
+
+
+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.js, + line 72 +

+
+
+
+
+
+
+
+
+

+ anotherMethod( value, + obj [, ...objN ] ) → {Object} +

+
+

This is a another test instance method of the MyApi test class, test markdown.

+
+
+
+
+
+
Description
+
+

+ This method is overridden in the + MyApi.Child class and should remove the exception documentation + as it no longer applies. +

+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value* +

Any value, test markdown

+
objObject +

+ The first object of what could be many, test + markdown +

+
objNObject<optional>
<repeatable>
+

+ Any additional objects, test + markdown +

+
+
+
+
Returns
+
+
+ +
+
+

+ The combination of all the objects, test + markdown. +

+
+
+
+
+
+
+
Fires
+
+
+ +
+
+

+ This is an event raised by this class, it's documentation appears on this page as the + event is specified as an inner member the class by using the tilde (~) scope. +

+
+
+
+
+
+
+
Throws
+
+
+ +
+
+

This is thrown when some condition fails within this method.

+
+
+
+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.js, + line 95 +

+
+
+
+
+
+
+
+

Type Definitions

+
+
+
+

+ Object +

+
+

This is a test type definition on the MyApi.Class class.

+
+
+
+
+
+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
namestring +

The name of the test object.

+
enabledboolean<optional>
false +

Whether or not the test object is enabled. Defaults to false.

+
subObject +

An object containing a subset of properties.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
id + number + +

The subset id.

+
name + boolean + <optional>
"Sub Options" +

+ The name of the sub object. Defaults to + "Sub Options". +

+
+
+
+
+
Details
+
+ +
+ +
+
+ Object +
+
+
+ + +
+ +
+

+ MyApi.js, + line 117 +

+
+
+
+
+
+
+
+

Events

+
+
+
+

+ "test.my-api" +

+
+

+ This is an event raised by this class, it's documentation appears on this page as the event is + specified as an inner member the class by using the tilde (~) scope. +

+
+
+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eEvent +

The event object.

+
custom* +

Some custom parameter passed to any listeners.

+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.js, + line 85 +

+
+
+
+
+
+
+
+
+

+ "another.my-api" +

+
+

+ This is an event raised by this class, it's documentation appears on this page as the event is + specified as an inner member the class by using the tilde (~) scope. +

+
+
+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eEvent +

The event object.

+
custom* +

Some custom parameter passed to any listeners.

+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.js, + line 108 +

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/MyApi.html b/__DOCS__/JSDocTemplate/.test/MyApi.html index bd540f8..a573919 100644 --- a/__DOCS__/JSDocTemplate/.test/MyApi.html +++ b/__DOCS__/JSDocTemplate/.test/MyApi.html @@ -1,334 +1,434 @@ - - - - - - MyApi - - - - - - - - - - - -
-
-
- -
-
-
-

MyApi

-

This is the test summary for the MyApi namespace.

-
-
-
Description

This is the longer description for the namespace giving a better idea about the code contained within it.

-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

Classes

-
-
-
-

new Class( arg1 [, ...arg2 ] )

-

This is the summary of the MyApi test class, test markdown.

-
-
-
-
-
-
-

new Child()

-

This is the summary of the MyApi child class, test markdown.

-
-
-
-
-
-

Namespaces

-
-
-
-

utils

-

This is to test child namespaces.

-
-
-
-
-
-

Members

-
-
-
-

<static> staticMember :string

-

This is a static member of the namespace.

-
-
-
Details
- - -
- -
-
string
-
-
- - -
- -
-

I'm a member of the MyApi namespace.

-
-
- - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-

Type Definitions

-
-
-
-

Object

-

This is a test type definition on the MyApi namespace.

-
-
-
-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
namestring -

This is the name of the test object.

-
enabledboolean<optional>
false -

This is whether or not the test object is enabled. Defaults to false.

-
-
-
Details
- - -
- -
-
Object
-
-
- - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + MyApi + + + + + + + + + + + + +
+
+
+ +
+
+
+

MyApi

+
+

+ This is the test summary for the + MyApi namespace. +

+
+
+
+
+
+
Description
+
+

+ This is the longer description for the namespace giving a better idea about the code contained + within it. +

+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.js, + line 1 +

+
+
+
+
+
+
+
+
+

Classes

+
+
+
+

+ new Class( arg1 [, ...arg2 ] ) +

+
+

+ This is the summary of the MyApi test class, test + markdown. +

+
+
+
+
+
+
+
+

+ new Child() +

+
+

+ This is the summary of the MyApi child class, test + markdown. +

+
+
+
+
+
+
+

Namespaces

+
+
+
+

+ utils +

+
+

This is to test child namespaces.

+
+
+
+
+
+
+

Members

+
+
+
+

+ <static> staticMember :string +

+
+

This is a static member of the namespace.

+
+
+
+
+
+
Details
+
+ +
+ +
+
+ string +
+
+
+ + +
+ +
+

I'm a member of the MyApi namespace.

+
+
+ + +
+ +
+

+ MyApi.js, + line 7 +

+
+
+
+
+
+
+
+

Type Definitions

+
+
+
+

+ Object +

+
+

This is a test type definition on the MyApi namespace.

+
+
+
+
+
+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
namestring +

This is the name of the test object.

+
enabledboolean<optional>
false +

This is whether or not the test object is enabled. Defaults to false.

+
+
+
+
Details
+
+ +
+ +
+
+ Object +
+
+
+ + +
+ +
+

+ MyApi.js, + line 17 +

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/MyApi.js.html b/__DOCS__/JSDocTemplate/.test/MyApi.js.html index 7e731b5..a05d64d 100644 --- a/__DOCS__/JSDocTemplate/.test/MyApi.js.html +++ b/__DOCS__/JSDocTemplate/.test/MyApi.js.html @@ -1,291 +1,368 @@ - - - - - - - MyApi.js - - - - - - - - - - - -
-
-
-
-
-
/**
- * @summary This is the test summary for the `MyApi` namespace.
- * @namespace MyApi
- * @description This is the longer description for the namespace giving a better idea about the code contained within it.
- */
-window.MyApi = {
-	/**
-	 * @summary This is a static member of the namespace.
-	 * @memberof MyApi.
-	 * @name staticMember
-	 * @type {string}
-	 * @default I'm a member of the MyApi namespace.
-	 */
-	staticMember: "I'm a member of the MyApi namespace."
-};
-
-/**
- * @summary This is a test type definition on the MyApi namespace.
- * @memberof MyApi~
- * @typedef {Object} Object
- * @prop {string} name - This is the name of the test object.
- * @prop {boolean} [enabled=false] - This is whether or not the test object is enabled. Defaults to `false`.
- */
-
-/**
- * @summary This is the summary of the MyApi test class, test `markdown`.
- * @memberof MyApi
- * @constructor Class
- * @param {string} arg1 - The first test arg, test `markdown`.
- * @param {...string} [arg2=false] - A repeatable, optional argument with a default value of false, test `markdown`.
- * @description This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test `markdown`
- * @example {@caption You can provide example captions with `markdown` and specify the language to use when rendering the code, defaults to `javascript`.}
- * var gc = new GlobalClass("arg1", "arg2");
- * @example {@lang xml}
- * <head>
- * 	<title>HTML Highlighting</title>
- * 	<script>
- * 	  // supports embedded languages
- * 		var gc = new GlobalClass("arg1", "arg2");
- * 	</script>
- * </head>
- */
-MyApi.Class = function(arg1, arg2){
-	/**
-	 * @summary I'm a member of the class.
-	 * @memberof MyApi.Class#
-	 * @name publicMember
-	 * @type {string}
-	 * @default "I'm an instance member."
-	 */
-	this.publicMember = "I'm an instance member.";
-	/**
-	 * @summary I'm a protected member of the class.
-	 * @memberof MyApi.Class#
-	 * @name protectedMember
-	 * @type {string}
-	 * @default "I'm a protected member."
-	 * @protected
-	 */
-	this.protectedMember = "I'm a protected member.";
-	/**
-	 * @summary I'm a private member of the class.
-	 * @memberof MyApi.Class#
-	 * @name _privateMember
-	 * @type {string}
-	 * @default "I'm a private member."
-	 * @private
-	 */
-	this._privateMember = "I'm a private member.";
-};
-
-/**
- * @summary This is a test instance method of the MyApi test class, test `markdown`.
- * @memberof MyApi.Class#
- * @function testMethod
- * @param {*} value - Any value, test `markdown`
- * @param {Object} obj - The first object of what could be many, test `markdown`
- * @param {...Object} [objN] - Any additional objects, test `markdown`
- * @returns {Object} The combination of all the objects, test `markdown`.
- * @description This method is not overridden in the {@link MyApi.Child} class but is simply inherited.
- * @fires MyApi.Class~"test.my-api"
- * @throws {CustomError} This is thrown when some condition fails within this method.
- */
-MyApi.Class.prototype.testMethod = function(value, obj, objN){
-	/**
-	 * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.
-	 * @memberof MyApi.Class~
-	 * @event "test.my-api"
-	 * @param {Event} e - The event object.
-	 * @param {*} custom - Some custom parameter passed to any listeners.
-	 */
-	throw new CustomError("Some custom error.");
-};
-
-/**
- * @summary This is a another test instance method of the MyApi test class, test `markdown`.
- * @memberof MyApi.Class#
- * @function anotherMethod
- * @param {*} value - Any value, test `markdown`
- * @param {Object} obj - The first object of what could be many, test `markdown`
- * @param {...Object} [objN] - Any additional objects, test `markdown`
- * @returns {Object} The combination of all the objects, test `markdown`.
- * @description This method is overridden in the {@link MyApi.Child} class and should remove the exception documentation as it no longer applies.
- * @fires MyApi.Class~"another.my-api"
- * @throws {CustomError} This is thrown when some condition fails within this method.
- */
-MyApi.Class.prototype.anotherMethod = function(value, obj, objN){
-	/**
-	 * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.
-	 * @memberof MyApi.Class~
-	 * @event "another.my-api"
-	 * @param {Event} e - The event object.
-	 * @param {*} custom - Some custom parameter passed to any listeners.
-	 */
-};
-
-/**
- * @summary This is a test type definition on the MyApi.Class class.
- * @memberof MyApi.Class~
- * @typedef {Object} Object
- * @prop {string} name - The name of the test object.
- * @prop {boolean} [enabled=false] - Whether or not the test object is enabled. Defaults to `false`.
- * @prop {Object} sub - An object containing a subset of properties.
- * @prop {number} sub.id - The subset id.
- * @prop {boolean} [sub.name="Sub Options"] - The name of the sub object. Defaults to `"Sub Options"`.
- */
-
-/**
- * @summary This is the summary of the MyApi child class, test `markdown`.
- * @memberof MyApi
- * @constructor Child
- * @extends MyApi.Class
- */
-MyApi.Child = function(){
-	/**
-	 * @summary I'm a protected member of the class.
-	 * @memberof MyApi.Child#
-	 * @name protectedMember
-	 * @type {string}
-	 * @default "I'm a protected member."
-	 * @protected
-	 */
-	this.protectedMember = "I'm a protected member.";
-};
-
-/**
- * @summary This is a another test instance method of the MyApi child class, test `markdown`.
- * @memberof MyApi.Child#
- * @function anotherMethod
- * @param {*} value - Any value, test `markdown`
- * @param {Object} obj - The first object of what could be many, test `markdown`
- * @param {...Object} [objN] - Any additional objects, test `markdown`
- * @returns {Object} The combination of all the objects, test `markdown`.
- * @description This method overrides the {@link MyApi.Class#anotherMethod} and should remove the exception documentation as it no longer applies. The event should also be updated to reflect it is raised by this class and not the inherited one.
- * @fires MyApi.Child~"another.my-api"
- */
-MyApi.Child.prototype.anotherMethod = function(value, obj, objN){
-	/**
-	 * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.
-	 * @memberof MyApi.Child~
-	 * @event "another.my-api"
-	 * @param {Event} e - The event object.
-	 * @param {*} custom - Some custom parameter passed to any listeners.
-	 */
-};
-
-
-
-
- - - - - - - - - - - - - \ No newline at end of file + + + + + + + MyApi.js + + + + + + + + + + + + +
+
+
+
+
+
/**
+ * @summary This is the test summary for the `MyApi` namespace.
+ * @namespace MyApi
+ * @description This is the longer description for the namespace giving a better idea about the code contained within it.
+ */
+window.MyApi = {
+	/**
+	 * @summary This is a static member of the namespace.
+	 * @memberof MyApi.
+	 * @name staticMember
+	 * @type {string}
+	 * @default I'm a member of the MyApi namespace.
+	 */
+	staticMember: "I'm a member of the MyApi namespace."
+};
+
+/**
+ * @summary This is a test type definition on the MyApi namespace.
+ * @memberof MyApi~
+ * @typedef {Object} Object
+ * @prop {string} name - This is the name of the test object.
+ * @prop {boolean} [enabled=false] - This is whether or not the test object is enabled. Defaults to `false`.
+ */
+
+/**
+ * @summary This is the summary of the MyApi test class, test `markdown`.
+ * @memberof MyApi
+ * @constructor Class
+ * @param {string} arg1 - The first test arg, test `markdown`.
+ * @param {...string} [arg2=false] - A repeatable, optional argument with a default value of false, test `markdown`.
+ * @description This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test `markdown`
+ * @example {@caption You can provide example captions with `markdown` and specify the language to use when rendering the code, defaults to `javascript`.}
+ * var gc = new GlobalClass("arg1", "arg2");
+ * @example {@lang xml}
+ * <head>
+ * 	<title>HTML Highlighting</title>
+ * 	<script>
+ * 	  // supports embedded languages
+ * 		var gc = new GlobalClass("arg1", "arg2");
+ * 	</script>
+ * </head>
+ */
+MyApi.Class = function(arg1, arg2){
+	/**
+	 * @summary I'm a member of the class.
+	 * @memberof MyApi.Class#
+	 * @name publicMember
+	 * @type {string}
+	 * @default "I'm an instance member."
+	 */
+	this.publicMember = "I'm an instance member.";
+	/**
+	 * @summary I'm a protected member of the class.
+	 * @memberof MyApi.Class#
+	 * @name protectedMember
+	 * @type {string}
+	 * @default "I'm a protected member."
+	 * @protected
+	 */
+	this.protectedMember = "I'm a protected member.";
+	/**
+	 * @summary I'm a private member of the class.
+	 * @memberof MyApi.Class#
+	 * @name _privateMember
+	 * @type {string}
+	 * @default "I'm a private member."
+	 * @private
+	 */
+	this._privateMember = "I'm a private member.";
+};
+
+/**
+ * @summary This is a test instance method of the MyApi test class, test `markdown`.
+ * @memberof MyApi.Class#
+ * @function testMethod
+ * @param {*} value - Any value, test `markdown`
+ * @param {Object} obj - The first object of what could be many, test `markdown`
+ * @param {...Object} [objN] - Any additional objects, test `markdown`
+ * @returns {Object} The combination of all the objects, test `markdown`.
+ * @description This method is not overridden in the {@link MyApi.Child} class but is simply inherited.
+ * @fires MyApi.Class~"test.my-api"
+ * @throws {CustomError} This is thrown when some condition fails within this method.
+ */
+MyApi.Class.prototype.testMethod = function(value, obj, objN){
+	/**
+	 * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.
+	 * @memberof MyApi.Class~
+	 * @event "test.my-api"
+	 * @param {Event} e - The event object.
+	 * @param {*} custom - Some custom parameter passed to any listeners.
+	 */
+	throw new CustomError("Some custom error.");
+};
+
+/**
+ * @summary This is a another test instance method of the MyApi test class, test `markdown`.
+ * @memberof MyApi.Class#
+ * @function anotherMethod
+ * @param {*} value - Any value, test `markdown`
+ * @param {Object} obj - The first object of what could be many, test `markdown`
+ * @param {...Object} [objN] - Any additional objects, test `markdown`
+ * @returns {Object} The combination of all the objects, test `markdown`.
+ * @description This method is overridden in the {@link MyApi.Child} class and should remove the exception documentation as it no longer applies.
+ * @fires MyApi.Class~"another.my-api"
+ * @throws {CustomError} This is thrown when some condition fails within this method.
+ */
+MyApi.Class.prototype.anotherMethod = function(value, obj, objN){
+	/**
+	 * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.
+	 * @memberof MyApi.Class~
+	 * @event "another.my-api"
+	 * @param {Event} e - The event object.
+	 * @param {*} custom - Some custom parameter passed to any listeners.
+	 */
+};
+
+/**
+ * @summary This is a test type definition on the MyApi.Class class.
+ * @memberof MyApi.Class~
+ * @typedef {Object} Object
+ * @prop {string} name - The name of the test object.
+ * @prop {boolean} [enabled=false] - Whether or not the test object is enabled. Defaults to `false`.
+ * @prop {Object} sub - An object containing a subset of properties.
+ * @prop {number} sub.id - The subset id.
+ * @prop {boolean} [sub.name="Sub Options"] - The name of the sub object. Defaults to `"Sub Options"`.
+ */
+
+/**
+ * @summary This is the summary of the MyApi child class, test `markdown`.
+ * @memberof MyApi
+ * @constructor Child
+ * @extends MyApi.Class
+ */
+MyApi.Child = function(){
+	/**
+	 * @summary I'm a protected member of the class.
+	 * @memberof MyApi.Child#
+	 * @name protectedMember
+	 * @type {string}
+	 * @default "I'm a protected member."
+	 * @protected
+	 */
+	this.protectedMember = "I'm a protected member.";
+};
+
+/**
+ * @summary This is a another test instance method of the MyApi child class, test `markdown`.
+ * @memberof MyApi.Child#
+ * @function anotherMethod
+ * @param {*} value - Any value, test `markdown`
+ * @param {Object} obj - The first object of what could be many, test `markdown`
+ * @param {...Object} [objN] - Any additional objects, test `markdown`
+ * @returns {Object} The combination of all the objects, test `markdown`.
+ * @description This method overrides the {@link MyApi.Class#anotherMethod} and should remove the exception documentation as it no longer applies. The event should also be updated to reflect it is raised by this class and not the inherited one.
+ * @fires MyApi.Child~"another.my-api"
+ */
+MyApi.Child.prototype.anotherMethod = function(value, obj, objN){
+	/**
+	 * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope.
+	 * @memberof MyApi.Child~
+	 * @event "another.my-api"
+	 * @param {Event} e - The event object.
+	 * @param {*} custom - Some custom parameter passed to any listeners.
+	 */
+};
+
+
+
+
+ + + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/MyApi.utils.html b/__DOCS__/JSDocTemplate/.test/MyApi.utils.html index 82aa947..4062181 100644 --- a/__DOCS__/JSDocTemplate/.test/MyApi.utils.html +++ b/__DOCS__/JSDocTemplate/.test/MyApi.utils.html @@ -1,260 +1,338 @@ - - - - - - MyApi.utils - - - - - - - - - - - -
-
-
- -
-
-
-

utils

-

This is to test child namespaces.

-
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-

Methods

-
-
-
-

<static> format( str, arg [, ...argN ] ) → {string}

-

Formats the supplied str with the given replacement args and there indexes.

-
-
-
-
Parameters
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
strstring -

The format string.

-
arg* -

The first of argument to format into the string.

-
argN*<optional>
<repeatable>
-

Any number of additional arguments.

-
-
-
Returns
-
- -
-

The given str formatted with the supplied arguments.

-
-
-
-
Examples

Basic usage:

-
-

var result = MyApi.utils.format( "Hello {0}! My name is {1}.", "Jill", "Jack" ); // => "Hello Jill! My name is Jack."
-
-
Details
- - - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + MyApi.utils + + + + + + + + + + + + +
+
+
+ +
+
+
+

utils

+
+

This is to test child namespaces.

+
+
+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.utils.js, + line 1 +

+
+
+
+
+
+
+
+
+

Methods

+
+
+
+

+ <static> format( str, + arg [, ...argN ] ) → {string} +

+
+

Formats the supplied str with the given replacement args and there indexes.

+
+
+
+
+
+
Parameters
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
strstring +

The format string.

+
arg* +

The first of argument to format into the string.

+
argN*<optional>
<repeatable>
+

Any number of additional arguments.

+
+
+
+
Returns
+
+
+ +
+
+

The given str formatted with the supplied arguments.

+
+
+
+
+
+
+
Examples
+

Basic usage:

+
+

+var result = MyApi.utils.format( "Hello {0}! My name is {1}.", "Jill", "Jack" ); // => "Hello Jill! My name is Jack."
+
+
+
+
Details
+
+ +
+ +
+

+ MyApi.utils.js, + line 8 +

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/MyApi.utils.js.html b/__DOCS__/JSDocTemplate/.test/MyApi.utils.js.html index 2fe935d..bf31a21 100644 --- a/__DOCS__/JSDocTemplate/.test/MyApi.utils.js.html +++ b/__DOCS__/JSDocTemplate/.test/MyApi.utils.js.html @@ -1,147 +1,224 @@ - - - - - - - MyApi.utils.js - - - - - - - - - - - -
-
-
-
-
-
/**
- * @summary This is to test child namespaces.
- * @memberof MyApi.
- * @namespace utils
- */
-MyApi.utils = {};
-
-/**
- * @summary Formats the supplied `str` with the given replacement args and there indexes.
- * @memberof MyApi.utils.
- * @function format
- * @param {string} str - The format string.
- * @param {*} arg - The first of argument to format into the string.
- * @param {...*} [argN] - Any number of additional arguments.
- * @returns {string} The given `str` formatted with the supplied arguments.
- * @example {@caption Basic usage:}
- * var result = MyApi.utils.format( "Hello {0}! My name is {1}.", "Jill", "Jack" ); // => "Hello Jill! My name is Jack."
- */
-MyApi.utils.format = function(str, arg, argN){
-
-};
-
-
-
-
- - - - - - - - - - - - - \ No newline at end of file + + + + + + + MyApi.utils.js + + + + + + + + + + + + +
+
+
+
+
+
/**
+ * @summary This is to test child namespaces.
+ * @memberof MyApi.
+ * @namespace utils
+ */
+MyApi.utils = {};
+
+/**
+ * @summary Formats the supplied `str` with the given replacement args and there indexes.
+ * @memberof MyApi.utils.
+ * @function format
+ * @param {string} str - The format string.
+ * @param {*} arg - The first of argument to format into the string.
+ * @param {...*} [argN] - Any number of additional arguments.
+ * @returns {string} The given `str` formatted with the supplied arguments.
+ * @example {@caption Basic usage:}
+ * var result = MyApi.utils.format( "Hello {0}! My name is {1}.", "Jill", "Jack" ); // => "Hello Jill! My name is Jack."
+ */
+MyApi.utils.format = function(str, arg, argN){
+
+};
+
+
+
+
+ + + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/css/bootstrap.min.css b/__DOCS__/JSDocTemplate/.test/css/bootstrap.min.css index ed3905e..742c65a 100644 --- a/__DOCS__/JSDocTemplate/.test/css/bootstrap.min.css +++ b/__DOCS__/JSDocTemplate/.test/css/bootstrap.min.css @@ -2,5 +2,6977 @@ * Bootstrap v3.3.7 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} -/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file + */ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: 700; +} +dfn { + font-style: italic; +} +h1 { + margin: 0.67em 0; + font-size: 2em; +} +mark { + color: #000; + background: #ff0; +} +small { + font-size: 80%; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + height: 0; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + margin: 0; + font: inherit; + color: inherit; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + padding: 0.35em 0.625em 0.75em; + margin: 0 2px; + border: 1px solid silver; +} +legend { + padding: 0; + border: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: 700; +} +table { + border-spacing: 0; + border-collapse: collapse; +} +td, +th { + padding: 0; +} /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + :after, + :before { + color: #000 !important; + text-shadow: none !important; + background: 0 0 !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + blockquote, + pre { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + img, + tr { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + h2, + h3, + p { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + .navbar { + display: none; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + .table-bordered td, + .table-bordered th { + border: 1px solid #ddd !important; + } +} +@font-face { + font-family: "Glyphicons Halflings"; + src: url(../fonts/glyphicons-halflings-regular.eot); + src: url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"), + url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"), + url(../fonts/glyphicons-halflings-regular.woff) format("woff"), + url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"), + url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg"); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: "Glyphicons Halflings"; + font-style: normal; + font-weight: 400; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\002a"; +} +.glyphicon-plus:before { + content: "\002b"; +} +.glyphicon-eur:before, +.glyphicon-euro:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.glyphicon-cd:before { + content: "\e201"; +} +.glyphicon-save-file:before { + content: "\e202"; +} +.glyphicon-open-file:before { + content: "\e203"; +} +.glyphicon-level-up:before { + content: "\e204"; +} +.glyphicon-copy:before { + content: "\e205"; +} +.glyphicon-paste:before { + content: "\e206"; +} +.glyphicon-alert:before { + content: "\e209"; +} +.glyphicon-equalizer:before { + content: "\e210"; +} +.glyphicon-king:before { + content: "\e211"; +} +.glyphicon-queen:before { + content: "\e212"; +} +.glyphicon-pawn:before { + content: "\e213"; +} +.glyphicon-bishop:before { + content: "\e214"; +} +.glyphicon-knight:before { + content: "\e215"; +} +.glyphicon-baby-formula:before { + content: "\e216"; +} +.glyphicon-tent:before { + content: "\26fa"; +} +.glyphicon-blackboard:before { + content: "\e218"; +} +.glyphicon-bed:before { + content: "\e219"; +} +.glyphicon-apple:before { + content: "\f8ff"; +} +.glyphicon-erase:before { + content: "\e221"; +} +.glyphicon-hourglass:before { + content: "\231b"; +} +.glyphicon-lamp:before { + content: "\e223"; +} +.glyphicon-duplicate:before { + content: "\e224"; +} +.glyphicon-piggy-bank:before { + content: "\e225"; +} +.glyphicon-scissors:before { + content: "\e226"; +} +.glyphicon-bitcoin:before { + content: "\e227"; +} +.glyphicon-btc:before { + content: "\e227"; +} +.glyphicon-xbt:before { + content: "\e227"; +} +.glyphicon-yen:before { + content: "\00a5"; +} +.glyphicon-jpy:before { + content: "\00a5"; +} +.glyphicon-ruble:before { + content: "\20bd"; +} +.glyphicon-rub:before { + content: "\20bd"; +} +.glyphicon-scale:before { + content: "\e230"; +} +.glyphicon-ice-lolly:before { + content: "\e231"; +} +.glyphicon-ice-lolly-tasted:before { + content: "\e232"; +} +.glyphicon-education:before { + content: "\e233"; +} +.glyphicon-option-horizontal:before { + content: "\e234"; +} +.glyphicon-option-vertical:before { + content: "\e235"; +} +.glyphicon-menu-hamburger:before { + content: "\e236"; +} +.glyphicon-modal-window:before { + content: "\e237"; +} +.glyphicon-oil:before { + content: "\e238"; +} +.glyphicon-grain:before { + content: "\e239"; +} +.glyphicon-sunglasses:before { + content: "\e240"; +} +.glyphicon-text-size:before { + content: "\e241"; +} +.glyphicon-text-color:before { + content: "\e242"; +} +.glyphicon-text-background:before { + content: "\e243"; +} +.glyphicon-object-align-top:before { + content: "\e244"; +} +.glyphicon-object-align-bottom:before { + content: "\e245"; +} +.glyphicon-object-align-horizontal:before { + content: "\e246"; +} +.glyphicon-object-align-left:before { + content: "\e247"; +} +.glyphicon-object-align-vertical:before { + content: "\e248"; +} +.glyphicon-object-align-right:before { + content: "\e249"; +} +.glyphicon-triangle-right:before { + content: "\e250"; +} +.glyphicon-triangle-left:before { + content: "\e251"; +} +.glyphicon-triangle-bottom:before { + content: "\e252"; +} +.glyphicon-triangle-top:before { + content: "\e253"; +} +.glyphicon-console:before { + content: "\e254"; +} +.glyphicon-superscript:before { + content: "\e255"; +} +.glyphicon-subscript:before { + content: "\e256"; +} +.glyphicon-menu-left:before { + content: "\e257"; +} +.glyphicon-menu-right:before { + content: "\e258"; +} +.glyphicon-menu-down:before { + content: "\e259"; +} +.glyphicon-menu-up:before { + content: "\e260"; +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +:after, +:before { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.42857143; + color: #333; + background-color: #fff; +} +button, +input, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #337ab7; + text-decoration: none; +} +a:focus, +a:hover { + color: #23527c; + text-decoration: underline; +} +a:focus { + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.carousel-inner > .item > a > img, +.carousel-inner > .item > img, +.img-responsive, +.thumbnail a > img, +.thumbnail > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + display: inline-block; + max-width: 100%; + height: auto; + padding: 4px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +[role="button"] { + cursor: pointer; +} +.h1, +.h2, +.h3, +.h4, +.h5, +.h6, +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} +.h1 .small, +.h1 small, +.h2 .small, +.h2 small, +.h3 .small, +.h3 small, +.h4 .small, +.h4 small, +.h5 .small, +.h5 small, +.h6 .small, +.h6 small, +h1 .small, +h1 small, +h2 .small, +h2 small, +h3 .small, +h3 small, +h4 .small, +h4 small, +h5 .small, +h5 small, +h6 .small, +h6 small { + font-weight: 400; + line-height: 1; + color: #777; +} +.h1, +.h2, +.h3, +h1, +h2, +h3 { + margin-top: 20px; + margin-bottom: 10px; +} +.h1 .small, +.h1 small, +.h2 .small, +.h2 small, +.h3 .small, +.h3 small, +h1 .small, +h1 small, +h2 .small, +h2 small, +h3 .small, +h3 small { + font-size: 65%; +} +.h4, +.h5, +.h6, +h4, +h5, +h6 { + margin-top: 10px; + margin-bottom: 10px; +} +.h4 .small, +.h4 small, +.h5 .small, +.h5 small, +.h6 .small, +.h6 small, +h4 .small, +h4 small, +h5 .small, +h5 small, +h6 .small, +h6 small { + font-size: 75%; +} +.h1, +h1 { + font-size: 36px; +} +.h2, +h2 { + font-size: 30px; +} +.h3, +h3 { + font-size: 24px; +} +.h4, +h4 { + font-size: 18px; +} +.h5, +h5 { + font-size: 14px; +} +.h6, +h6 { + font-size: 12px; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 300; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} +.small, +small { + font-size: 85%; +} +.mark, +mark { + padding: 0.2em; + background-color: #fcf8e3; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-muted { + color: #777; +} +.text-primary { + color: #337ab7; +} +a.text-primary:focus, +a.text-primary:hover { + color: #286090; +} +.text-success { + color: #3c763d; +} +a.text-success:focus, +a.text-success:hover { + color: #2b542c; +} +.text-info { + color: #31708f; +} +a.text-info:focus, +a.text-info:hover { + color: #245269; +} +.text-warning { + color: #8a6d3b; +} +a.text-warning:focus, +a.text-warning:hover { + color: #66512c; +} +.text-danger { + color: #a94442; +} +a.text-danger:focus, +a.text-danger:hover { + color: #843534; +} +.bg-primary { + color: #fff; + background-color: #337ab7; +} +a.bg-primary:focus, +a.bg-primary:hover { + background-color: #286090; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:focus, +a.bg-success:hover { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:focus, +a.bg-info:hover { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:focus, +a.bg-warning:hover { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:focus, +a.bg-danger:hover { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eee; +} +ol, +ul { + margin-top: 0; + margin-bottom: 10px; +} +ol ol, +ol ul, +ul ol, +ul ul { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + margin-left: -5px; + list-style: none; +} +.list-inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} +dl { + margin-top: 0; + margin-bottom: 20px; +} +dd, +dt { + line-height: 1.42857143; +} +dt { + font-weight: 700; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[data-original-title], +abbr[title] { + cursor: help; + border-bottom: 1px dotted #777; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eee; +} +blockquote ol:last-child, +blockquote p:last-child, +blockquote ul:last-child { + margin-bottom: 0; +} +blockquote .small, +blockquote footer, +blockquote small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #777; +} +blockquote .small:before, +blockquote footer:before, +blockquote small:before { + content: "\2014 \00A0"; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + text-align: right; + border-right: 5px solid #eee; + border-left: 0; +} +.blockquote-reverse .small:before, +.blockquote-reverse footer:before, +.blockquote-reverse small:before, +blockquote.pull-right .small:before, +blockquote.pull-right footer:before, +blockquote.pull-right small:before { + content: ""; +} +.blockquote-reverse .small:after, +.blockquote-reverse footer:after, +.blockquote-reverse small:after, +blockquote.pull-right .small:after, +blockquote.pull-right footer:after, +blockquote.pull-right small:after { + content: "\00A0 \2014"; +} +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #fff; + background-color: #333; + border-radius: 3px; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: 700; + -webkit-box-shadow: none; + box-shadow: none; +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.42857143; + color: #333; + word-break: break-all; + word-wrap: break-word; + background-color: #f5f5f5; + border: 1px solid #ccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +.row { + margin-right: -15px; + margin-left: -15px; +} +.col-lg-1, +.col-lg-10, +.col-lg-11, +.col-lg-12, +.col-lg-2, +.col-lg-3, +.col-lg-4, +.col-lg-5, +.col-lg-6, +.col-lg-7, +.col-lg-8, +.col-lg-9, +.col-md-1, +.col-md-10, +.col-md-11, +.col-md-12, +.col-md-2, +.col-md-3, +.col-md-4, +.col-md-5, +.col-md-6, +.col-md-7, +.col-md-8, +.col-md-9, +.col-sm-1, +.col-sm-10, +.col-sm-11, +.col-sm-12, +.col-sm-2, +.col-sm-3, +.col-sm-4, +.col-sm-5, +.col-sm-6, +.col-sm-7, +.col-sm-8, +.col-sm-9, +.col-xs-1, +.col-xs-10, +.col-xs-11, +.col-xs-12, +.col-xs-2, +.col-xs-3, +.col-xs-4, +.col-xs-5, +.col-xs-6, +.col-xs-7, +.col-xs-8, +.col-xs-9 { + position: relative; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} +.col-xs-1, +.col-xs-10, +.col-xs-11, +.col-xs-12, +.col-xs-2, +.col-xs-3, +.col-xs-4, +.col-xs-5, +.col-xs-6, +.col-xs-7, +.col-xs-8, +.col-xs-9 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0; +} +@media (min-width: 768px) { + .col-sm-1, + .col-sm-10, + .col-sm-11, + .col-sm-12, + .col-sm-2, + .col-sm-3, + .col-sm-4, + .col-sm-5, + .col-sm-6, + .col-sm-7, + .col-sm-8, + .col-sm-9 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0; + } +} +@media (min-width: 992px) { + .col-md-1, + .col-md-10, + .col-md-11, + .col-md-12, + .col-md-2, + .col-md-3, + .col-md-4, + .col-md-5, + .col-md-6, + .col-md-7, + .col-md-8, + .col-md-9 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0; + } +} +@media (min-width: 1200px) { + .col-lg-1, + .col-lg-10, + .col-lg-11, + .col-lg-12, + .col-lg-2, + .col-lg-3, + .col-lg-4, + .col-lg-5, + .col-lg-6, + .col-lg-7, + .col-lg-8, + .col-lg-9 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0; + } +} +table { + background-color: transparent; +} +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #777; + text-align: left; +} +th { + text-align: left; +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 20px; +} +.table > tbody > tr > td, +.table > tbody > tr > th, +.table > tfoot > tr > td, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > thead > tr > th { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #ddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #ddd; +} +.table > caption + thead > tr:first-child > td, +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > td, +.table > thead:first-child > tr:first-child > th { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #ddd; +} +.table .table { + background-color: #fff; +} +.table-condensed > tbody > tr > td, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > td, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > thead > tr > th { + padding: 5px; +} +.table-bordered { + border: 1px solid #ddd; +} +.table-bordered > tbody > tr > td, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > td, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > thead > tr > th { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > td, +.table-bordered > thead > tr > th { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + display: table-column; + float: none; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + display: table-cell; + float: none; +} +.table > tbody > tr.active > td, +.table > tbody > tr.active > th, +.table > tbody > tr > td.active, +.table > tbody > tr > th.active, +.table > tfoot > tr.active > td, +.table > tfoot > tr.active > th, +.table > tfoot > tr > td.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > thead > tr.active > th, +.table > thead > tr > td.active, +.table > thead > tr > th.active { + background-color: #f5f5f5; +} +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr.active:hover > th, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover { + background-color: #e8e8e8; +} +.table > tbody > tr.success > td, +.table > tbody > tr.success > th, +.table > tbody > tr > td.success, +.table > tbody > tr > th.success, +.table > tfoot > tr.success > td, +.table > tfoot > tr.success > th, +.table > tfoot > tr > td.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > thead > tr.success > th, +.table > thead > tr > td.success, +.table > thead > tr > th.success { + background-color: #dff0d8; +} +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr.success:hover > th, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover { + background-color: #d0e9c6; +} +.table > tbody > tr.info > td, +.table > tbody > tr.info > th, +.table > tbody > tr > td.info, +.table > tbody > tr > th.info, +.table > tfoot > tr.info > td, +.table > tfoot > tr.info > th, +.table > tfoot > tr > td.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > thead > tr.info > th, +.table > thead > tr > td.info, +.table > thead > tr > th.info { + background-color: #d9edf7; +} +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr.info:hover > th, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover { + background-color: #c4e3f3; +} +.table > tbody > tr.warning > td, +.table > tbody > tr.warning > th, +.table > tbody > tr > td.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr.warning > td, +.table > tfoot > tr.warning > th, +.table > tfoot > tr > td.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > thead > tr.warning > th, +.table > thead > tr > td.warning, +.table > thead > tr > th.warning { + background-color: #fcf8e3; +} +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr.warning:hover > th, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover { + background-color: #faf2cc; +} +.table > tbody > tr.danger > td, +.table > tbody > tr.danger > th, +.table > tbody > tr > td.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr.danger > td, +.table > tfoot > tr.danger > th, +.table > tfoot > tr > td.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > thead > tr.danger > th, +.table > thead > tr > td.danger, +.table > thead > tr > th.danger { + background-color: #f2dede; +} +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr.danger:hover > th, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover { + background-color: #ebcccc; +} +.table-responsive { + min-height: 0.01%; + overflow-x: auto; +} +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #ddd; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > td, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > thead > tr > th { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > thead > tr > th:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > thead > tr > th:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; + } +} +fieldset { + min-width: 0; + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: inherit; + color: #333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: 700; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="checkbox"], +input[type="radio"] { + margin: 4px 0 0; + margin-top: 1px\9; + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="checkbox"]:focus, +input[type="radio"]:focus { + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.42857143; + color: #555; +} +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s; + -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.form-control::-moz-placeholder { + color: #999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999; +} +.form-control::-webkit-input-placeholder { + color: #999; +} +.form-control::-ms-expand { + background-color: transparent; + border: 0; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + background-color: #eee; + opacity: 1; +} +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"].form-control, + input[type="time"].form-control, + input[type="datetime-local"].form-control, + input[type="month"].form-control { + line-height: 34px; + } + .input-group-sm input[type="date"], + .input-group-sm input[type="time"], + .input-group-sm input[type="datetime-local"], + .input-group-sm input[type="month"], + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm { + line-height: 30px; + } + .input-group-lg input[type="date"], + .input-group-lg input[type="time"], + .input-group-lg input[type="datetime-local"], + .input-group-lg input[type="month"], + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg { + line-height: 46px; + } +} +.form-group { + margin-bottom: 15px; +} +.checkbox, +.radio { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; +} +.checkbox label, +.radio label { + min-height: 20px; + padding-left: 20px; + margin-bottom: 0; + font-weight: 400; + cursor: pointer; +} +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"], +.radio input[type="radio"], +.radio-inline input[type="radio"] { + position: absolute; + margin-top: 4px\9; + margin-left: -20px; +} +.checkbox + .checkbox, +.radio + .radio { + margin-top: -5px; +} +.checkbox-inline, +.radio-inline { + position: relative; + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + font-weight: 400; + vertical-align: middle; + cursor: pointer; +} +.checkbox-inline + .checkbox-inline, +.radio-inline + .radio-inline { + margin-top: 0; + margin-left: 10px; +} +fieldset[disabled] input[type="checkbox"], +fieldset[disabled] input[type="radio"], +input[type="checkbox"].disabled, +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="radio"][disabled] { + cursor: not-allowed; +} +.checkbox-inline.disabled, +.radio-inline.disabled, +fieldset[disabled] .checkbox-inline, +fieldset[disabled] .radio-inline { + cursor: not-allowed; +} +.checkbox.disabled label, +.radio.disabled label, +fieldset[disabled] .checkbox label, +fieldset[disabled] .radio label { + cursor: not-allowed; +} +.form-control-static { + min-height: 34px; + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-right: 0; + padding-left: 0; +} +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +select[multiple].input-sm, +textarea.input-sm { + height: auto; +} +.form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.form-group-sm select.form-control { + height: 30px; + line-height: 30px; +} +.form-group-sm select[multiple].form-control, +.form-group-sm textarea.form-control { + height: auto; +} +.form-group-sm .form-control-static { + height: 30px; + min-height: 32px; + padding: 6px 10px; + font-size: 12px; + line-height: 1.5; +} +.input-lg { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-lg { + height: 46px; + line-height: 46px; +} +select[multiple].input-lg, +textarea.input-lg { + height: auto; +} +.form-group-lg .form-control { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +.form-group-lg select.form-control { + height: 46px; + line-height: 46px; +} +.form-group-lg select[multiple].form-control, +.form-group-lg textarea.form-control { + height: auto; +} +.form-group-lg .form-control-static { + height: 46px; + min-height: 38px; + padding: 11px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 42.5px; +} +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; + pointer-events: none; +} +.form-group-lg .form-control + .form-control-feedback, +.input-group-lg + .form-control-feedback, +.input-lg + .form-control-feedback { + width: 46px; + height: 46px; + line-height: 46px; +} +.form-group-sm .form-control + .form-control-feedback, +.input-group-sm + .form-control-feedback, +.input-sm + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; +} +.has-success .checkbox, +.has-success .checkbox-inline, +.has-success .control-label, +.has-success .help-block, +.has-success .radio, +.has-success .radio-inline, +.has-success.checkbox label, +.has-success.checkbox-inline label, +.has-success.radio label, +.has-success.radio-inline label { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + background-color: #dff0d8; + border-color: #3c763d; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .checkbox, +.has-warning .checkbox-inline, +.has-warning .control-label, +.has-warning .help-block, +.has-warning .radio, +.has-warning .radio-inline, +.has-warning.checkbox label, +.has-warning.checkbox-inline label, +.has-warning.radio label, +.has-warning.radio-inline label { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #8a6d3b; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .checkbox, +.has-error .checkbox-inline, +.has-error .control-label, +.has-error .help-block, +.has-error .radio, +.has-error .radio-inline, +.has-error.checkbox label, +.has-error.checkbox-inline label, +.has-error.radio label, +.has-error.radio-inline label { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + background-color: #f2dede; + border-color: #a94442; +} +.has-error .form-control-feedback { + color: #a94442; +} +.has-feedback label ~ .form-control-feedback { + top: 25px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .form-control, + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .checkbox, + .form-inline .radio { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .checkbox label, + .form-inline .radio label { + padding-left: 0; + } + .form-inline .checkbox input[type="checkbox"], + .form-inline .radio input[type="radio"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .checkbox, +.form-horizontal .checkbox-inline, +.form-horizontal .radio, +.form-horizontal .radio-inline { + padding-top: 7px; + margin-top: 0; + margin-bottom: 0; +} +.form-horizontal .checkbox, +.form-horizontal .radio { + min-height: 27px; +} +.form-horizontal .form-group { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + padding-top: 7px; + margin-bottom: 0; + text-align: right; + } +} +.form-horizontal .has-feedback .form-control-feedback { + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 11px; + font-size: 18px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + font-size: 12px; + } +} +.btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: 400; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.btn.active.focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn:active:focus, +.btn:focus { + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn.focus, +.btn:focus, +.btn:hover { + color: #333; + text-decoration: none; +} +.btn.active, +.btn:active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; + opacity: 0.65; +} +a.btn.disabled, +fieldset[disabled] a.btn { + pointer-events: none; +} +.btn-default { + color: #333; + background-color: #fff; + border-color: #ccc; +} +.btn-default.focus, +.btn-default:focus { + color: #333; + background-color: #e6e6e6; + border-color: #8c8c8c; +} +.btn-default:hover { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default.active, +.btn-default:active, +.open > .dropdown-toggle.btn-default { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default.active.focus, +.btn-default.active:focus, +.btn-default.active:hover, +.btn-default:active.focus, +.btn-default:active:focus, +.btn-default:active:hover, +.open > .dropdown-toggle.btn-default.focus, +.open > .dropdown-toggle.btn-default:focus, +.open > .dropdown-toggle.btn-default:hover { + color: #333; + background-color: #d4d4d4; + border-color: #8c8c8c; +} +.btn-default.active, +.btn-default:active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled.focus, +.btn-default.disabled:focus, +.btn-default.disabled:hover, +.btn-default[disabled].focus, +.btn-default[disabled]:focus, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default.focus, +fieldset[disabled] .btn-default:focus, +fieldset[disabled] .btn-default:hover { + background-color: #fff; + border-color: #ccc; +} +.btn-default .badge { + color: #fff; + background-color: #333; +} +.btn-primary { + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary.focus, +.btn-primary:focus { + color: #fff; + background-color: #286090; + border-color: #122b40; +} +.btn-primary:hover { + color: #fff; + background-color: #286090; + border-color: #204d74; +} +.btn-primary.active, +.btn-primary:active, +.open > .dropdown-toggle.btn-primary { + color: #fff; + background-color: #286090; + border-color: #204d74; +} +.btn-primary.active.focus, +.btn-primary.active:focus, +.btn-primary.active:hover, +.btn-primary:active.focus, +.btn-primary:active:focus, +.btn-primary:active:hover, +.open > .dropdown-toggle.btn-primary.focus, +.open > .dropdown-toggle.btn-primary:focus, +.open > .dropdown-toggle.btn-primary:hover { + color: #fff; + background-color: #204d74; + border-color: #122b40; +} +.btn-primary.active, +.btn-primary:active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled.focus, +.btn-primary.disabled:focus, +.btn-primary.disabled:hover, +.btn-primary[disabled].focus, +.btn-primary[disabled]:focus, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary.focus, +fieldset[disabled] .btn-primary:focus, +fieldset[disabled] .btn-primary:hover { + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary .badge { + color: #337ab7; + background-color: #fff; +} +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success.focus, +.btn-success:focus { + color: #fff; + background-color: #449d44; + border-color: #255625; +} +.btn-success:hover { + color: #fff; + background-color: #449d44; + border-color: #398439; +} +.btn-success.active, +.btn-success:active, +.open > .dropdown-toggle.btn-success { + color: #fff; + background-color: #449d44; + border-color: #398439; +} +.btn-success.active.focus, +.btn-success.active:focus, +.btn-success.active:hover, +.btn-success:active.focus, +.btn-success:active:focus, +.btn-success:active:hover, +.open > .dropdown-toggle.btn-success.focus, +.open > .dropdown-toggle.btn-success:focus, +.open > .dropdown-toggle.btn-success:hover { + color: #fff; + background-color: #398439; + border-color: #255625; +} +.btn-success.active, +.btn-success:active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled.focus, +.btn-success.disabled:focus, +.btn-success.disabled:hover, +.btn-success[disabled].focus, +.btn-success[disabled]:focus, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success.focus, +fieldset[disabled] .btn-success:focus, +fieldset[disabled] .btn-success:hover { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #fff; +} +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info.focus, +.btn-info:focus { + color: #fff; + background-color: #31b0d5; + border-color: #1b6d85; +} +.btn-info:hover { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info.active, +.btn-info:active, +.open > .dropdown-toggle.btn-info { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info.active.focus, +.btn-info.active:focus, +.btn-info.active:hover, +.btn-info:active.focus, +.btn-info:active:focus, +.btn-info:active:hover, +.open > .dropdown-toggle.btn-info.focus, +.open > .dropdown-toggle.btn-info:focus, +.open > .dropdown-toggle.btn-info:hover { + color: #fff; + background-color: #269abc; + border-color: #1b6d85; +} +.btn-info.active, +.btn-info:active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled.focus, +.btn-info.disabled:focus, +.btn-info.disabled:hover, +.btn-info[disabled].focus, +.btn-info[disabled]:focus, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info.focus, +fieldset[disabled] .btn-info:focus, +fieldset[disabled] .btn-info:hover { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #fff; +} +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning.focus, +.btn-warning:focus { + color: #fff; + background-color: #ec971f; + border-color: #985f0d; +} +.btn-warning:hover { + color: #fff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning.active, +.btn-warning:active, +.open > .dropdown-toggle.btn-warning { + color: #fff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning.active.focus, +.btn-warning.active:focus, +.btn-warning.active:hover, +.btn-warning:active.focus, +.btn-warning:active:focus, +.btn-warning:active:hover, +.open > .dropdown-toggle.btn-warning.focus, +.open > .dropdown-toggle.btn-warning:focus, +.open > .dropdown-toggle.btn-warning:hover { + color: #fff; + background-color: #d58512; + border-color: #985f0d; +} +.btn-warning.active, +.btn-warning:active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled.focus, +.btn-warning.disabled:focus, +.btn-warning.disabled:hover, +.btn-warning[disabled].focus, +.btn-warning[disabled]:focus, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning.focus, +fieldset[disabled] .btn-warning:focus, +fieldset[disabled] .btn-warning:hover { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #fff; +} +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger.focus, +.btn-danger:focus { + color: #fff; + background-color: #c9302c; + border-color: #761c19; +} +.btn-danger:hover { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger.active, +.btn-danger:active, +.open > .dropdown-toggle.btn-danger { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger.active.focus, +.btn-danger.active:focus, +.btn-danger.active:hover, +.btn-danger:active.focus, +.btn-danger:active:focus, +.btn-danger:active:hover, +.open > .dropdown-toggle.btn-danger.focus, +.open > .dropdown-toggle.btn-danger:focus, +.open > .dropdown-toggle.btn-danger:hover { + color: #fff; + background-color: #ac2925; + border-color: #761c19; +} +.btn-danger.active, +.btn-danger:active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled.focus, +.btn-danger.disabled:focus, +.btn-danger.disabled:hover, +.btn-danger[disabled].focus, +.btn-danger[disabled]:focus, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger.focus, +fieldset[disabled] .btn-danger:focus, +fieldset[disabled] .btn-danger:hover { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #fff; +} +.btn-link { + font-weight: 400; + color: #337ab7; + border-radius: 0; +} +.btn-link, +.btn-link.active, +.btn-link:active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:active, +.btn-link:focus, +.btn-link:hover { + border-color: transparent; +} +.btn-link:focus, +.btn-link:hover { + color: #23527c; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:focus, +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:focus, +fieldset[disabled] .btn-link:hover { + color: #777; + text-decoration: none; +} +.btn-group-lg > .btn, +.btn-lg { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +.btn-group-sm > .btn, +.btn-sm { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-group-xs > .btn, +.btn-xs { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="button"].btn-block, +input[type="reset"].btn-block, +input[type="submit"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; + -webkit-transition-duration: 0.35s; + -o-transition-duration: 0.35s; + transition-duration: 0.35s; + -webkit-transition-property: height, visibility; + -o-transition-property: height, visibility; + transition-property: height, visibility; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px dashed; + border-top: 4px solid\9; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropdown, +.dropup { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + text-align: left; + list-style: none; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: 400; + line-height: 1.42857143; + color: #333; + white-space: nowrap; +} +.dropdown-menu > li > a:focus, +.dropdown-menu > li > a:hover { + color: #262626; + text-decoration: none; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:focus, +.dropdown-menu > .active > a:hover { + color: #fff; + text-decoration: none; + background-color: #337ab7; + outline: 0; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:focus, +.dropdown-menu > .disabled > a:hover { + color: #777; +} +.dropdown-menu > .disabled > a:focus, +.dropdown-menu > .disabled > a:hover { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + right: 0; + left: auto; +} +.dropdown-menu-left { + right: auto; + left: 0; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #777; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + content: ""; + border-top: 0; + border-bottom: 4px dashed; + border-bottom: 4px solid\9; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + right: 0; + left: auto; + } + .navbar-right .dropdown-menu-left { + right: auto; + left: 0; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group-vertical > .btn, +.btn-group > .btn { + position: relative; + float: left; +} +.btn-group-vertical > .btn.active, +.btn-group-vertical > .btn:active, +.btn-group-vertical > .btn:focus, +.btn-group-vertical > .btn:hover, +.btn-group > .btn.active, +.btn-group > .btn:active, +.btn-group > .btn:focus, +.btn-group > .btn:hover { + z-index: 2; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn, +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-right: 8px; + padding-left: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-right: 12px; + padding-left: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + display: table-cell; + float: none; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-right: 0; + padding-left: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group .form-control:focus { + z-index: 3; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn, +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn, +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group .form-control, +.input-group-addon, +.input-group-btn { + display: table-cell; +} +.input-group .form-control:not(:first-child):not(:last-child), +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: 400; + line-height: 1; + color: #555; + text-align: center; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="checkbox"], +.input-group-addon input[type="radio"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:active, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:hover { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + z-index: 2; + margin-left: -1px; +} +.nav { + padding-left: 0; + margin-bottom: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:focus, +.nav > li > a:hover { + text-decoration: none; + background-color: #eee; +} +.nav > li.disabled > a { + color: #777; +} +.nav > li.disabled > a:focus, +.nav > li.disabled > a:hover { + color: #777; + text-decoration: none; + cursor: not-allowed; + background-color: transparent; +} +.nav .open > a, +.nav .open > a:focus, +.nav .open > a:hover { + background-color: #eee; + border-color: #337ab7; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eee #eee #ddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:focus, +.nav-tabs > li.active > a:hover { + color: #555; + cursor: default; + background-color: #fff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:focus, +.nav-tabs.nav-justified > .active > a:hover { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:focus, + .nav-tabs.nav-justified > .active > a:hover { + border-bottom-color: #fff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:focus, +.nav-pills > li.active > a:hover { + color: #fff; + background-color: #337ab7; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:focus, +.nav-tabs-justified > .active > a:hover { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:focus, + .nav-tabs-justified > .active > a:hover { + border-bottom-color: #fff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + padding-right: 15px; + padding-left: 15px; + overflow-x: visible; + -webkit-overflow-scrolling: touch; + border-top: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-bottom .navbar-collapse, + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse { + padding-right: 0; + padding-left: 0; + } +} +.navbar-fixed-bottom .navbar-collapse, +.navbar-fixed-top .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-bottom .navbar-collapse, + .navbar-fixed-top .navbar-collapse { + max-height: 200px; + } +} +.container-fluid > .navbar-collapse, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container > .navbar-header { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container-fluid > .navbar-collapse, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container > .navbar-header { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-bottom, +.navbar-fixed-top { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-bottom, + .navbar-fixed-top { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + height: 50px; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; +} +.navbar-brand:focus, +.navbar-brand:hover { + text-decoration: none; +} +.navbar-brand > img { + display: block; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + padding: 9px 10px; + margin-top: 8px; + margin-right: 15px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu .dropdown-header, + .navbar-nav .open .dropdown-menu > li > a { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:focus, + .navbar-nav .open .dropdown-menu > li > a:hover { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } +} +.navbar-form { + padding: 10px 15px; + margin-top: 8px; + margin-right: -15px; + margin-bottom: 8px; + margin-left: -15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .form-control, + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .checkbox, + .navbar-form .radio { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .checkbox label, + .navbar-form .radio label { + padding-left: 0; + } + .navbar-form .checkbox input[type="checkbox"], + .navbar-form .radio input[type="radio"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + padding-top: 0; + padding-bottom: 0; + margin-right: 0; + margin-left: 0; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-right: 15px; + margin-left: 15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + margin-right: -15px; + } + .navbar-right ~ .navbar-right { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777; +} +.navbar-default .navbar-brand:focus, +.navbar-default .navbar-brand:hover { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777; +} +.navbar-default .navbar-nav > li > a { + color: #777; +} +.navbar-default .navbar-nav > li > a:focus, +.navbar-default .navbar-nav > li > a:hover { + color: #333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:focus, +.navbar-default .navbar-nav > .active > a:hover { + color: #555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:focus, +.navbar-default .navbar-nav > .disabled > a:hover { + color: #ccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #ddd; +} +.navbar-default .navbar-toggle:focus, +.navbar-default .navbar-toggle:hover { + background-color: #ddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #888; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:focus, +.navbar-default .navbar-nav > .open > a:hover { + color: #555; + background-color: #e7e7e7; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover { + color: #333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover { + color: #555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover { + color: #ccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777; +} +.navbar-default .navbar-link:hover { + color: #333; +} +.navbar-default .btn-link { + color: #777; +} +.navbar-default .btn-link:focus, +.navbar-default .btn-link:hover { + color: #333; +} +.navbar-default .btn-link[disabled]:focus, +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:focus, +fieldset[disabled] .navbar-default .btn-link:hover { + color: #ccc; +} +.navbar-inverse { + background-color: #222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #9d9d9d; +} +.navbar-inverse .navbar-brand:focus, +.navbar-inverse .navbar-brand:hover { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a:focus, +.navbar-inverse .navbar-nav > li > a:hover { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:focus, +.navbar-inverse .navbar-nav > .active > a:hover { + color: #fff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:focus, +.navbar-inverse .navbar-nav > .disabled > a:hover { + color: #444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333; +} +.navbar-inverse .navbar-toggle:focus, +.navbar-inverse .navbar-toggle:hover { + background-color: #333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #fff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:focus, +.navbar-inverse .navbar-nav > .open > a:hover { + color: #fff; + background-color: #080808; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #9d9d9d; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover { + color: #fff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover { + color: #fff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover { + color: #444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #9d9d9d; +} +.navbar-inverse .navbar-link:hover { + color: #fff; +} +.navbar-inverse .btn-link { + color: #9d9d9d; +} +.navbar-inverse .btn-link:focus, +.navbar-inverse .btn-link:hover { + color: #fff; +} +.navbar-inverse .btn-link[disabled]:focus, +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:focus, +fieldset[disabled] .navbar-inverse .btn-link:hover { + color: #444; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + padding: 0 5px; + color: #ccc; + content: "/\00a0"; +} +.breadcrumb > .active { + color: #777; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #337ab7; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.pagination > li > a:focus, +.pagination > li > a:hover, +.pagination > li > span:focus, +.pagination > li > span:hover { + z-index: 2; + color: #23527c; + background-color: #eee; + border-color: #ddd; +} +.pagination > .active > a, +.pagination > .active > a:focus, +.pagination > .active > a:hover, +.pagination > .active > span, +.pagination > .active > span:focus, +.pagination > .active > span:hover { + z-index: 3; + color: #fff; + cursor: default; + background-color: #337ab7; + border-color: #337ab7; +} +.pagination > .disabled > a, +.pagination > .disabled > a:focus, +.pagination > .disabled > a:hover, +.pagination > .disabled > span, +.pagination > .disabled > span:focus, +.pagination > .disabled > span:hover { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + text-align: center; + list-style: none; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; +} +.pager li > a:focus, +.pager li > a:hover { + text-decoration: none; + background-color: #eee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:focus, +.pager .disabled > a:hover, +.pager .disabled > span { + color: #777; + cursor: not-allowed; + background-color: #fff; +} +.label { + display: inline; + padding: 0.2em 0.6em 0.3em; + font-size: 75%; + font-weight: 700; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: 0.25em; +} +a.label:focus, +a.label:hover { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #777; +} +.label-default[href]:focus, +.label-default[href]:hover { + background-color: #5e5e5e; +} +.label-primary { + background-color: #337ab7; +} +.label-primary[href]:focus, +.label-primary[href]:hover { + background-color: #286090; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:focus, +.label-success[href]:hover { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:focus, +.label-info[href]:hover { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:focus, +.label-warning[href]:hover { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:focus, +.label-danger[href]:hover { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: 700; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: middle; + background-color: #777; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-group-xs > .btn .badge, +.btn-xs .badge { + top: 0; + padding: 1px 5px; +} +a.badge:focus, +a.badge:hover { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #337ab7; + background-color: #fff; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding-top: 30px; + padding-bottom: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #eee; +} +.jumbotron .h1, +.jumbotron h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #d5d5d5; +} +.container .jumbotron, +.container-fluid .jumbotron { + padding-right: 15px; + padding-left: 15px; + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron, + .container-fluid .jumbotron { + padding-right: 60px; + padding-left: 60px; + } + .jumbotron .h1, + .jumbotron h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: border 0.2s ease-in-out; + -o-transition: border 0.2s ease-in-out; + transition: border 0.2s ease-in-out; +} +.thumbnail a > img, +.thumbnail > img { + margin-right: auto; + margin-left: auto; +} +a.thumbnail.active, +a.thumbnail:focus, +a.thumbnail:hover { + border-color: #337ab7; +} +.thumbnail .caption { + padding: 9px; + color: #333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: 700; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} +.progress-bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #fff; + text-align: center; + background-color: #337ab7; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-bar-striped, +.progress-striped .progress-bar { + background-image: -webkit-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: -o-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress-bar.active, +.progress.active .progress-bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: -o-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: -o-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: -o-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: -o-linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); + background-image: linear-gradient( + 45deg, + rgba(255, 255, 255, 0.15) 25%, + transparent 25%, + transparent 50%, + rgba(255, 255, 255, 0.15) 50%, + rgba(255, 255, 255, 0.15) 75%, + transparent 75%, + transparent + ); +} +.media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media, +.media-body { + overflow: hidden; + zoom: 1; +} +.media-body { + width: 10000px; +} +.media-object { + display: block; +} +.media-object.img-thumbnail { + max-width: none; +} +.media-right, +.media > .pull-right { + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-body, +.media-left, +.media-right { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + padding-left: 0; + margin-bottom: 20px; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid #ddd; +} +.list-group-item:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item, +button.list-group-item { + color: #555; +} +a.list-group-item .list-group-item-heading, +button.list-group-item .list-group-item-heading { + color: #333; +} +a.list-group-item:focus, +a.list-group-item:hover, +button.list-group-item:focus, +button.list-group-item:hover { + color: #555; + text-decoration: none; + background-color: #f5f5f5; +} +button.list-group-item { + width: 100%; + text-align: left; +} +.list-group-item.disabled, +.list-group-item.disabled:focus, +.list-group-item.disabled:hover { + color: #777; + cursor: not-allowed; + background-color: #eee; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text { + color: #777; +} +.list-group-item.active, +.list-group-item.active:focus, +.list-group-item.active:hover { + z-index: 2; + color: #fff; + background-color: #337ab7; + border-color: #337ab7; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:focus .list-group-item-text, +.list-group-item.active:hover .list-group-item-text { + color: #c7ddef; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success, +button.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading, +button.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:focus, +a.list-group-item-success:hover, +button.list-group-item-success:focus, +button.list-group-item-success:hover { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +a.list-group-item-success.active:focus, +a.list-group-item-success.active:hover, +button.list-group-item-success.active, +button.list-group-item-success.active:focus, +button.list-group-item-success.active:hover { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info, +button.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading, +button.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:focus, +a.list-group-item-info:hover, +button.list-group-item-info:focus, +button.list-group-item-info:hover { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +a.list-group-item-info.active:focus, +a.list-group-item-info.active:hover, +button.list-group-item-info.active, +button.list-group-item-info.active:focus, +button.list-group-item-info.active:hover { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning, +button.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading, +button.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:focus, +a.list-group-item-warning:hover, +button.list-group-item-warning:focus, +button.list-group-item-warning:hover { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +a.list-group-item-warning.active:focus, +a.list-group-item-warning.active:hover, +button.list-group-item-warning.active, +button.list-group-item-warning.active:focus, +button.list-group-item-warning.active:hover { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger, +button.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading, +button.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:focus, +a.list-group-item-danger:hover, +button.list-group-item-danger:focus, +button.list-group-item-danger:hover { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +a.list-group-item-danger.active:focus, +a.list-group-item-danger.active:hover, +button.list-group-item-danger.active, +button.list-group-item-danger.active:focus, +button.list-group-item-danger.active:hover { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > .small, +.panel-title > .small > a, +.panel-title > a, +.panel-title > small, +.panel-title > small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .panel-collapse > .table, +.panel > .table, +.panel > .table-responsive > .table { + margin-bottom: 0; +} +.panel > .panel-collapse > .table caption, +.panel > .table caption, +.panel > .table-responsive > .table caption { + padding-right: 15px; + padding-left: 15px; +} +.panel > .table-responsive:first-child > .table:first-child, +.panel > .table:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table-responsive:last-child > .table:last-child, +.panel > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #ddd; +} +.panel > .table > tbody:first-child > tr:first-child td, +.panel > .table > tbody:first-child > tr:first-child th { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child { + border-left: 0; +} +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child { + border-right: 0; +} +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + margin-bottom: 0; + border: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .list-group, +.panel-group .panel-heading + .panel-collapse > .panel-body { + border-top: 1px solid #ddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #ddd; +} +.panel-default { + border-color: #ddd; +} +.panel-default > .panel-heading { + color: #333; + background-color: #f5f5f5; + border-color: #ddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ddd; +} +.panel-primary { + border-color: #337ab7; +} +.panel-primary > .panel-heading { + color: #fff; + background-color: #337ab7; + border-color: #337ab7; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #337ab7; +} +.panel-primary > .panel-heading .badge { + color: #337ab7; + background-color: #fff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #337ab7; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ebccd1; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive embed, +.embed-responsive iframe, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; +} +.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: 700; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + filter: alpha(opacity=20); + opacity: 0.2; +} +.close:focus, +.close:hover { + color: #000; + text-decoration: none; + cursor: pointer; + filter: alpha(opacity=50); + opacity: 0.5; +} +button.close { + -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: 0 0; + border: 0; +} +.modal-open { + overflow: hidden; +} +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + display: none; + overflow: hidden; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transition: -webkit-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); + transform: translate(0, -25%); +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + outline: 0; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000; +} +.modal-backdrop.fade { + filter: alpha(opacity=0); + opacity: 0; +} +.modal-backdrop.in { + filter: alpha(opacity=50); + opacity: 0.5; +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 15px; +} +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: 1.42857143; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + white-space: normal; + filter: alpha(opacity=0); + opacity: 0; + line-break: auto; +} +.tooltip.in { + filter: alpha(opacity=90); + opacity: 0.9; +} +.tooltip.top { + padding: 5px 0; + margin-top: -3px; +} +.tooltip.right { + padding: 0 5px; + margin-left: 3px; +} +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; +} +.tooltip.left { + padding: 0 5px; + margin-left: -3px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #fff; + text-align: center; + background-color: #000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-left .tooltip-arrow { + right: 5px; + bottom: 0; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 1.42857143; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + white-space: normal; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + line-break: auto; +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + content: ""; + border-width: 10px; +} +.popover.top > .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, 0.25); + border-bottom-width: 0; +} +.popover.top > .arrow:after { + bottom: 1px; + margin-left: -10px; + content: " "; + border-top-color: #fff; + border-bottom-width: 0; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, 0.25); + border-left-width: 0; +} +.popover.right > .arrow:after { + bottom: -10px; + left: 1px; + content: " "; + border-right-color: #fff; + border-left-width: 0; +} +.popover.bottom > .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, 0.25); +} +.popover.bottom > .arrow:after { + top: 1px; + margin-left: -10px; + content: " "; + border-top-width: 0; + border-bottom-color: #fff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, 0.25); +} +.popover.left > .arrow:after { + right: 1px; + bottom: -10px; + content: " "; + border-right-width: 0; + border-left-color: #fff; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel-inner > .item > a > img, +.carousel-inner > .item > img { + line-height: 1; +} +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + -webkit-transition: -webkit-transform 0.6s ease-in-out; + -o-transition: -o-transform 0.6s ease-in-out; + transition: transform 0.6s ease-in-out; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000px; + perspective: 1000px; + } + .carousel-inner > .item.active.right, + .carousel-inner > .item.next { + left: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } + .carousel-inner > .item.active.left, + .carousel-inner > .item.prev { + left: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + .carousel-inner > .item.active, + .carousel-inner > .item.next.left, + .carousel-inner > .item.prev.right { + left: 0; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 15%; + font-size: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); + background-color: rgba(0, 0, 0, 0); + filter: alpha(opacity=50); + opacity: 0.5; +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001))); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control.right { + right: 0; + left: auto; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5))); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control:focus, +.carousel-control:hover { + color: #fff; + text-decoration: none; + filter: alpha(opacity=90); + outline: 0; + opacity: 0.9; +} +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right, +.carousel-control .icon-next, +.carousel-control .icon-prev { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; + margin-top: -10px; +} +.carousel-control .glyphicon-chevron-left, +.carousel-control .icon-prev { + left: 50%; + margin-left: -10px; +} +.carousel-control .glyphicon-chevron-right, +.carousel-control .icon-next { + right: 50%; + margin-right: -10px; +} +.carousel-control .icon-next, +.carousel-control .icon-prev { + width: 20px; + height: 20px; + font-family: serif; + line-height: 1; +} +.carousel-control .icon-prev:before { + content: "\2039"; +} +.carousel-control .icon-next:before { + content: "\203a"; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + padding-left: 0; + margin-left: -30%; + text-align: center; + list-style: none; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + cursor: pointer; + background-color: #000\9; + background-color: rgba(0, 0, 0, 0); + border: 1px solid #fff; + border-radius: 10px; +} +.carousel-indicators .active { + width: 12px; + height: 12px; + margin: 0; + background-color: #fff; +} +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next, + .carousel-control .icon-prev { + width: 30px; + height: 30px; + margin-top: -10px; + font-size: 30px; + } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -10px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -10px; + } + .carousel-caption { + right: 20%; + left: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.btn-group-vertical > .btn-group:after, +.btn-group-vertical > .btn-group:before, +.btn-toolbar:after, +.btn-toolbar:before, +.clearfix:after, +.clearfix:before, +.container-fluid:after, +.container-fluid:before, +.container:after, +.container:before, +.dl-horizontal dd:after, +.dl-horizontal dd:before, +.form-horizontal .form-group:after, +.form-horizontal .form-group:before, +.modal-footer:after, +.modal-footer:before, +.modal-header:after, +.modal-header:before, +.nav:after, +.nav:before, +.navbar-collapse:after, +.navbar-collapse:before, +.navbar-header:after, +.navbar-header:before, +.navbar:after, +.navbar:before, +.pager:after, +.pager:before, +.panel-body:after, +.panel-body:before, +.row:after, +.row:before { + display: table; + content: " "; +} +.btn-group-vertical > .btn-group:after, +.btn-toolbar:after, +.clearfix:after, +.container-fluid:after, +.container:after, +.dl-horizontal dd:after, +.form-horizontal .form-group:after, +.modal-footer:after, +.modal-header:after, +.nav:after, +.navbar-collapse:after, +.navbar-header:after, +.navbar:after, +.pager:after, +.panel-body:after, +.row:after { + clear: both; +} +.center-block { + display: block; + margin-right: auto; + margin-left: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-lg, +.visible-md, +.visible-sm, +.visible-xs { + display: none !important; +} +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table !important; + } + tr.visible-xs { + display: table-row !important; + } + td.visible-xs, + th.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table !important; + } + tr.visible-sm { + display: table-row !important; + } + td.visible-sm, + th.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table !important; + } + tr.visible-md { + display: table-row !important; + } + td.visible-md, + th.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table !important; + } + tr.visible-lg { + display: table-row !important; + } + td.visible-lg, + th.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table !important; + } + tr.visible-print { + display: table-row !important; + } + td.visible-print, + th.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +/*# sourceMappingURL=bootstrap.min.css.map */ diff --git a/__DOCS__/JSDocTemplate/.test/css/prism.css b/__DOCS__/JSDocTemplate/.test/css/prism.css index 9010cb6..ade0ad2 100644 --- a/__DOCS__/JSDocTemplate/.test/css/prism.css +++ b/__DOCS__/JSDocTemplate/.test/css/prism.css @@ -6,78 +6,82 @@ code[class*="language-"], pre[class*="language-"] { - color: black; - background: none; - text-shadow: 0 1px white; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - - -moz-tab-size: 4; - -o-tab-size: 4; - tab-size: 4; - - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - -pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, -code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; -} - -pre[class*="language-"]::selection, pre[class*="language-"] ::selection, -code[class*="language-"]::selection, code[class*="language-"] ::selection { - text-shadow: none; - background: #b3d4fc; + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; } @media print { - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } } /* Code blocks */ pre[class*="language-"] { - padding: 1em; - margin: .5em 0; - overflow: auto; + padding: 1em; + margin: 0.5em 0; + overflow: auto; } :not(pre) > code[class*="language-"], pre[class*="language-"] { - background: #f5f2f0; + background: #f5f2f0; } /* Inline code */ :not(pre) > code[class*="language-"] { - padding: .1em; - border-radius: .3em; - white-space: normal; + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; } .token.comment, .token.prolog, .token.doctype, .token.cdata { - color: slategray; + color: slategray; } .token.punctuation { - color: #999; + color: #999; } .namespace { - opacity: .7; + opacity: 0.7; } .token.property, @@ -87,7 +91,7 @@ pre[class*="language-"] { .token.constant, .token.symbol, .token.deleted { - color: #905; + color: #905; } .token.selector, @@ -96,7 +100,7 @@ pre[class*="language-"] { .token.char, .token.builtin, .token.inserted { - color: #690; + color: #690; } .token.operator, @@ -104,35 +108,35 @@ pre[class*="language-"] { .token.url, .language-css .token.string, .style .token.string { - color: #9a6e3a; - background: hsla(0, 0%, 100%, .5); + color: #9a6e3a; + background: hsla(0, 0%, 100%, 0.5); } .token.atrule, .token.attr-value, .token.keyword { - color: #07a; + color: #07a; } .token.function, .token.class-name { - color: #DD4A68; + color: #dd4a68; } .token.regex, .token.important, .token.variable { - color: #e90; + color: #e90; } .token.important, .token.bold { - font-weight: bold; + font-weight: bold; } .token.italic { - font-style: italic; + font-style: italic; } .token.entity { - cursor: help; + cursor: help; } diff --git a/__DOCS__/JSDocTemplate/.test/css/prism.min.css b/__DOCS__/JSDocTemplate/.test/css/prism.min.css index f51e15d..de89125 100644 --- a/__DOCS__/JSDocTemplate/.test/css/prism.min.css +++ b/__DOCS__/JSDocTemplate/.test/css/prism.min.css @@ -1 +1,280 @@ -code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}pre{border:1px solid #e1e1e8}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#f7f7f9}code[class*=language-],pre[class*=language-]{text-shadow:none;color:#333;-moz-tab-size:2;-o-tab-size:2;tab-size:2}.namespace{opacity:1}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{background:0 0}.token.boolean,.token.constant,.token.deleted,.token.number,.token.symbol{color:#270dd1}.token.atrule,.token.attr-value{color:#270dd1}.token.keyword,.token.tag{color:#aa0d91}.token.builtin,.token.char,.token.inserted,.token.property,.token.string{color:#c41a16}.language-css .token.string,.token.url{color:#40a9b1}.token.attr-name{color:#994500}.token.cdata,.token.doctype,.token.prolog{color:#999}.token.comment{color:#007400}.language-html .token.punctuation,.language-markup .token.punctuation{color:#b2a1b0}.token.function,.token.operator,.token.punctuation,.token.selector{color:#333}pre.line-numbers{position:relative;padding-left:4.8em;counter-reset:linenumber}pre.line-numbers>code{position:relative}.line-numbers .line-numbers-rows{position:absolute;top:0;font-size:100%;left:-4.8em;width:4em;letter-spacing:-1px;border-right:1px solid #e1e1e8;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>a{display:block;counter-increment:linenumber;color:#bdbdbd}.line-numbers-rows>a:hover{color:#9b9b9b}.line-numbers-rows>a:before{content:counter(linenumber);display:block;padding-right:.8em;text-align:right}pre.code-toolbar{position:relative}pre.code-toolbar>.toolbar{position:absolute;top:0;right:0;z-index:10;display:block;padding:0;font-size:12px;color:#767676;cursor:pointer;background-color:#fff;border-left:1px solid #e1e1e8;border-bottom:1px solid #e1e1e8;border-radius:0 4px 0 4px}pre.code-toolbar>.toolbar:hover{color:#fff;background-color:#337ab7;border-left-color:#337ab7;border-bottom-color:#337ab7}pre.code-toolbar>.toolbar .toolbar-item{display:inline-block}pre.code-toolbar>.toolbar a{cursor:pointer}pre.code-toolbar>.toolbar button{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}pre.code-toolbar>.toolbar a,pre.code-toolbar>.toolbar button,pre.code-toolbar>.toolbar span{color:inherit;padding:5px 8px;display:inline-block}pre.code-toolbar>.toolbar a:focus,pre.code-toolbar>.toolbar a:hover,pre.code-toolbar>.toolbar button:focus,pre.code-toolbar>.toolbar button:hover,pre.code-toolbar>.toolbar span:focus,pre.code-toolbar>.toolbar span:hover{color:inherit;text-decoration:none} \ No newline at end of file +code[class*="language-"], +pre[class*="language-"] { + color: #000; + background: 0 0; + text-shadow: 0 1px #fff; + font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} +code[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +pre[class*="language-"]::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} +code[class*="language-"] ::selection, +code[class*="language-"]::selection, +pre[class*="language-"] ::selection, +pre[class*="language-"]::selection { + text-shadow: none; + background: #b3d4fc; +} +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} +pre[class*="language-"] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; +} +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} +:not(pre) > code[class*="language-"] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} +.token.cdata, +.token.comment, +.token.doctype, +.token.prolog { + color: #708090; +} +.token.punctuation { + color: #999; +} +.namespace { + opacity: 0.7; +} +.token.boolean, +.token.constant, +.token.deleted, +.token.number, +.token.property, +.token.symbol, +.token.tag { + color: #905; +} +.token.attr-name, +.token.builtin, +.token.char, +.token.inserted, +.token.selector, +.token.string { + color: #690; +} +.language-css .token.string, +.style .token.string, +.token.entity, +.token.operator, +.token.url { + color: #9a6e3a; + background: hsla(0, 0%, 100%, 0.5); +} +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} +.token.class-name, +.token.function { + color: #dd4a68; +} +.token.important, +.token.regex, +.token.variable { + color: #e90; +} +.token.bold, +.token.important { + font-weight: 700; +} +.token.italic { + font-style: italic; +} +.token.entity { + cursor: help; +} +pre { + border: 1px solid #e1e1e8; +} +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background-color: #f7f7f9; +} +code[class*="language-"], +pre[class*="language-"] { + text-shadow: none; + color: #333; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +.namespace { + opacity: 1; +} +.language-css .token.string, +.style .token.string, +.token.entity, +.token.operator, +.token.url { + background: 0 0; +} +.token.boolean, +.token.constant, +.token.deleted, +.token.number, +.token.symbol { + color: #270dd1; +} +.token.atrule, +.token.attr-value { + color: #270dd1; +} +.token.keyword, +.token.tag { + color: #aa0d91; +} +.token.builtin, +.token.char, +.token.inserted, +.token.property, +.token.string { + color: #c41a16; +} +.language-css .token.string, +.token.url { + color: #40a9b1; +} +.token.attr-name { + color: #994500; +} +.token.cdata, +.token.doctype, +.token.prolog { + color: #999; +} +.token.comment { + color: #007400; +} +.language-html .token.punctuation, +.language-markup .token.punctuation { + color: #b2a1b0; +} +.token.function, +.token.operator, +.token.punctuation, +.token.selector { + color: #333; +} +pre.line-numbers { + position: relative; + padding-left: 4.8em; + counter-reset: linenumber; +} +pre.line-numbers > code { + position: relative; +} +.line-numbers .line-numbers-rows { + position: absolute; + top: 0; + font-size: 100%; + left: -4.8em; + width: 4em; + letter-spacing: -1px; + border-right: 1px solid #e1e1e8; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.line-numbers-rows > a { + display: block; + counter-increment: linenumber; + color: #bdbdbd; +} +.line-numbers-rows > a:hover { + color: #9b9b9b; +} +.line-numbers-rows > a:before { + content: counter(linenumber); + display: block; + padding-right: 0.8em; + text-align: right; +} +pre.code-toolbar { + position: relative; +} +pre.code-toolbar > .toolbar { + position: absolute; + top: 0; + right: 0; + z-index: 10; + display: block; + padding: 0; + font-size: 12px; + color: #767676; + cursor: pointer; + background-color: #fff; + border-left: 1px solid #e1e1e8; + border-bottom: 1px solid #e1e1e8; + border-radius: 0 4px 0 4px; +} +pre.code-toolbar > .toolbar:hover { + color: #fff; + background-color: #337ab7; + border-left-color: #337ab7; + border-bottom-color: #337ab7; +} +pre.code-toolbar > .toolbar .toolbar-item { + display: inline-block; +} +pre.code-toolbar > .toolbar a { + cursor: pointer; +} +pre.code-toolbar > .toolbar button { + background: 0 0; + border: 0; + color: inherit; + font: inherit; + line-height: normal; + overflow: visible; + padding: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} +pre.code-toolbar > .toolbar a, +pre.code-toolbar > .toolbar button, +pre.code-toolbar > .toolbar span { + color: inherit; + padding: 5px 8px; + display: inline-block; +} +pre.code-toolbar > .toolbar a:focus, +pre.code-toolbar > .toolbar a:hover, +pre.code-toolbar > .toolbar button:focus, +pre.code-toolbar > .toolbar button:hover, +pre.code-toolbar > .toolbar span:focus, +pre.code-toolbar > .toolbar span:hover { + color: inherit; + text-decoration: none; +} diff --git a/__DOCS__/JSDocTemplate/.test/css/template.min.css b/__DOCS__/JSDocTemplate/.test/css/template.min.css index abbb34c..cc49907 100644 --- a/__DOCS__/JSDocTemplate/.test/css/template.min.css +++ b/__DOCS__/JSDocTemplate/.test/css/template.min.css @@ -1 +1,537 @@ -html{margin-top:50px;background-color:#f9f9f9}.navbar-brand.branding-logo{background-position:15px center;background-size:40px;background-repeat:no-repeat;text-indent:44px}.main-content{padding-bottom:200px}.main-content h1,.main-content h2{border-bottom:1px solid #eee;margin-top:20px;margin-bottom:20px;padding-bottom:9px}.main-content .primary p+h1,.main-content .primary p+h2,.main-content .readme-section p+h1,.main-content .readme-section p+h2,.main-content .related-tutorials h2,.main-content .tutorial-section p+h1,.main-content .tutorial-section p+h2{margin-top:40px}footer{width:100%;max-width:100%;overflow:hidden;padding:15px;text-align:center;background-color:#f9f9f9;border-top:solid 1px #ddd;font-size:small;color:#777}.callout{padding:20px;margin:20px 0;border:1px solid #eee;border-left-width:5px;border-radius:3px}.callout h5{margin-top:0;margin-bottom:5px;font-family:inherit;font-weight:500;line-height:1.1;font-size:18px}.callout p:last-child,.callout table:last-child{margin-bottom:0}.callout code{border-radius:3px}.callout .control-label{color:#999;font-weight:400}.callout+.callout{margin-top:-5px}.callout-default{border-left-color:#999}.callout-default h5{color:#999}.callout-primary{border-left-color:#337ab7}.callout-primary h5{color:#337ab7}.callout-success{border-left-color:#5cb85c}.callout-success h5{color:#5cb85c}.callout-danger{border-left-color:#d9534f}.callout-danger h5{color:#d9534f}.callout-warning{border-left-color:#f0ad4e}.callout-warning h5{color:#f0ad4e}.callout-info{border-left-color:#87b9f1}.callout-info h5{color:#87b9f1}.callout-rpc{border-left-color:#c7bfd3}.callout-rpc h5{color:#c7bfd3}.callout-example{border-left-color:#8461b9}.callout-example h5{color:#8461b9}.callout .form-group{margin-bottom:5px}.callout .form-group>div.control-static>p{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.callout .table>thead>tr>th{font-weight:400}.page-header{margin-top:0;margin-bottom:40px;padding:15px 0;background-color:#337ab7}.page-header .kind{font-size:50px;line-height:1.1;text-transform:uppercase;opacity:.1;position:absolute;right:15px;color:#fff}.page-header h1{font-size:36px;line-height:1.1;margin-top:0;color:#fff}.page-header .ancestors{display:block;font-size:16px}.page-header .ancestors a{color:#fff;opacity:.3}.page-header .ancestors a:hover{opacity:1;text-decoration:underline}.page-header .ancestors+.name{margin-left:15px}.page-header p{font-size:20px;margin-bottom:0;font-weight:300;line-height:1.4;color:#d0d0d0}.page-header .container{position:relative}#topNavigation .dropdown-menu{max-height:640px;max-height:calc(100vh - 62px);overflow-y:auto}@media (min-width:768px){.page-header{padding-top:60px;padding-bottom:60px;text-align:left}.page-header .kind{font-size:80px;line-height:1}.page-header h1{font-size:60px;line-height:1}.page-header .ancestors{font-size:20px}.page-header p{font-size:24px}}dl.symbol dl.symbol{margin-left:15px;margin-bottom:15px}.symbol-title h1,.symbol-title h2,.symbol-title h3,.symbol-title h4,.symbol-title h5{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;padding-left:50px;text-indent:-50px}.main-content .symbol-title h1,.main-content .symbol-title h2{border-bottom:none;margin-bottom:inherit}.symbol-title .name-signature,.symbol-title .signature-params{color:#222}.symbol-title .name-string,.symbol-title .signature-param,.symbol-title h4.event{color:#c7254e}.symbol-details{overflow:hidden}.symbol-title.collapsible-symbol{cursor:pointer}.symbol-title.collapsible-symbol .toggle-icon{color:#337ab7;text-indent:0}.symbol-title.collapsible-symbol:hover .toggle-icon{opacity:.8}.symbol-details.collapsible-symbol{max-height:0}.symbol-details.collapsible-symbol.transition{transition:max-height .4s ease-in}.summary{font-size:15px;font-weight:400;color:grey}.signature-attribs,.signature-new,.signature-type{color:#adadad;font-size:smaller}.anchored{position:relative}.anchor-link{position:absolute;left:-55px;padding-right:15px;text-indent:0;display:inline-block;min-width:60px;text-align:right;opacity:0;visibility:hidden;color:#999}.anchor-link:hover{color:#777}.expanded .anchor-link,h1:hover .anchor-link,h2:hover .anchor-link,h3:hover .anchor-link,h4:hover .anchor-link{opacity:1;visibility:visible}.breadcrumb li a{color:#337ab7}.dummy-console{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:12px;resize:vertical;margin-bottom:15px}#lunr-search-footer .pagination{margin:0}.lunr-search-results-page{list-style:none;padding:0;display:none}.lunr-search-results-page.active{display:block}.lunr-search-results-page li{list-style:none;margin-bottom:20px}span.lunr-search-result-kind{text-transform:capitalize}a.lunr-search-result-title{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}a.lunr-search-result-title:hover{text-decoration:underline}p.lunr-search-result-url{color:#006621;font-size:13px;line-height:16px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}p.lunr-search-result-summary{color:#999;font-size:13px;line-height:16px;margin:0;overflow:hidden;max-height:48px;text-overflow:ellipsis}@media (min-width:992px){.navbar-form{width:228px}}@media (min-width:1200px){.navbar-form{width:278px}}.related-tutorials ul{margin-top:20px}.related-tutorials ul li a{font-size:16px;margin:5px 0;display:inline-block}.toc.affix{position:static}.toc-nav{margin-top:5px;padding-bottom:10px;max-height:95%;max-height:calc(100% - 2em);overflow-y:auto}.toc .nav>li>a{display:block;padding:4px 4px 4px 36px;text-indent:-20px;font-size:14px;font-weight:500;color:#767676}.toc .nav>li>a:focus,.toc .nav>li>a:hover{padding-left:35px;color:#337ab7;text-decoration:none;background-color:transparent;border-left:1px solid #337ab7}.toc .nav>li.active>a,.toc .nav>li.active>a:focus,.toc .nav>li.active>a:hover{padding-left:34px;color:#337ab7;background-color:transparent;border-left:2px solid #337ab7}.toc .nav .nav{display:none;padding-bottom:10px}.toc .nav .nav>li>a{font-size:13px;padding-left:39px;font-weight:400}.toc .nav .nav>li>a:focus,.toc .nav .nav>li>a:hover{padding-left:38px}.toc .nav .nav>li.active>a,.toc .nav .nav>li.active>a:focus,.toc .nav .nav>li.active>a:hover{padding-left:37px}.toc .nav .nav .nav>li>a{font-size:12px;padding-left:44px}.toc .nav .nav .nav>li>a:focus,.toc .nav .nav .nav>li>a:hover{padding-left:43px}.toc .nav .nav .nav>li.active>a,.toc .nav .nav .nav>li.active>a:focus,.toc .nav .nav .nav>li.active>a:hover{padding-left:42px}.toc .nav .nav .nav .nav>li>a{font-size:12px;padding-left:49px}.toc .nav .nav .nav .nav>li>a:focus,.toc .nav .nav .nav .nav>li>a:hover{padding-left:48px}.toc .nav .nav .nav .nav>li.active>a,.toc .nav .nav .nav .nav>li.active>a:focus,.toc .nav .nav .nav .nav>li.active>a:hover{padding-left:47px}.toc .nav>li>a .name-require{color:#767676}.toc .nav>li>a>.ancestors>span{color:#337ab7}.toc .nav>li>a .signature-attribs{font-weight:400}.toc .nav>li>a .name-signature,.toc .nav>li>a .signature-params{color:#000}.toc .nav>li.event>a .name,.toc .nav>li>a .name-string,.toc .nav>li>a .signature-param{color:#c7254e}.back-to-top{display:none;padding:4px 10px;margin-top:10px;margin-left:10px;font-size:12px;font-weight:500;color:#999;cursor:pointer}.back-to-top:hover{color:#337ab7;text-decoration:none}@media (min-width:768px){.back-to-top{display:block}}@media (min-width:992px){.toc .nav>.active>ul{display:block}.toc.affix,.toc.affix-bottom{width:213px}.toc.affix{position:fixed;top:67px;height:calc(100% - 67px - 50px)}.toc.affix-bottom{position:absolute}.toc.affix .toc-nav,.toc.affix-bottom .toc-nav{margin-top:0;margin-bottom:0}}@media (min-width:1200px){.toc.affix,.toc.affix-bottom{width:263px}}.access-filter{text-align:right;font-size:12px;padding:8px 15px;margin-top:0;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px;color:#767676}.breadcrumb+.access-filter{margin-top:-25px;margin-bottom:0}.access-filter .checkbox-inline input[type=checkbox]{margin:1px 0 0 -17px}.access-filter .checkbox-inline,.access-filter .checkbox-inline:before{color:#767676}.access-filter .checkbox-inline.checked,.access-filter .checkbox-inline:focus,.access-filter .checkbox-inline:hover{color:#337ab7}.access-filter .checkbox-inline:before{display:inline-block;position:relative;left:-25px}.access-filter .checkbox-inline:first-of-type:before{content:"Show -"}.access-filter .checkbox-inline+.checkbox-inline:before{content:"|"} \ No newline at end of file +html { + margin-top: 50px; + background-color: #f9f9f9; +} +.navbar-brand.branding-logo { + background-position: 15px center; + background-size: 40px; + background-repeat: no-repeat; + text-indent: 44px; +} +.main-content { + padding-bottom: 200px; +} +.main-content h1, +.main-content h2 { + border-bottom: 1px solid #eee; + margin-top: 20px; + margin-bottom: 20px; + padding-bottom: 9px; +} +.main-content .primary p + h1, +.main-content .primary p + h2, +.main-content .readme-section p + h1, +.main-content .readme-section p + h2, +.main-content .related-tutorials h2, +.main-content .tutorial-section p + h1, +.main-content .tutorial-section p + h2 { + margin-top: 40px; +} +footer { + width: 100%; + max-width: 100%; + overflow: hidden; + padding: 15px; + text-align: center; + background-color: #f9f9f9; + border-top: solid 1px #ddd; + font-size: small; + color: #777; +} +.callout { + padding: 20px; + margin: 20px 0; + border: 1px solid #eee; + border-left-width: 5px; + border-radius: 3px; +} +.callout h5 { + margin-top: 0; + margin-bottom: 5px; + font-family: inherit; + font-weight: 500; + line-height: 1.1; + font-size: 18px; +} +.callout p:last-child, +.callout table:last-child { + margin-bottom: 0; +} +.callout code { + border-radius: 3px; +} +.callout .control-label { + color: #999; + font-weight: 400; +} +.callout + .callout { + margin-top: -5px; +} +.callout-default { + border-left-color: #999; +} +.callout-default h5 { + color: #999; +} +.callout-primary { + border-left-color: #337ab7; +} +.callout-primary h5 { + color: #337ab7; +} +.callout-success { + border-left-color: #5cb85c; +} +.callout-success h5 { + color: #5cb85c; +} +.callout-danger { + border-left-color: #d9534f; +} +.callout-danger h5 { + color: #d9534f; +} +.callout-warning { + border-left-color: #f0ad4e; +} +.callout-warning h5 { + color: #f0ad4e; +} +.callout-info { + border-left-color: #87b9f1; +} +.callout-info h5 { + color: #87b9f1; +} +.callout-rpc { + border-left-color: #c7bfd3; +} +.callout-rpc h5 { + color: #c7bfd3; +} +.callout-example { + border-left-color: #8461b9; +} +.callout-example h5 { + color: #8461b9; +} +.callout .form-group { + margin-bottom: 5px; +} +.callout .form-group > div.control-static > p { + min-height: 34px; + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.callout .table > thead > tr > th { + font-weight: 400; +} +.page-header { + margin-top: 0; + margin-bottom: 40px; + padding: 15px 0; + background-color: #337ab7; +} +.page-header .kind { + font-size: 50px; + line-height: 1.1; + text-transform: uppercase; + opacity: 0.1; + position: absolute; + right: 15px; + color: #fff; +} +.page-header h1 { + font-size: 36px; + line-height: 1.1; + margin-top: 0; + color: #fff; +} +.page-header .ancestors { + display: block; + font-size: 16px; +} +.page-header .ancestors a { + color: #fff; + opacity: 0.3; +} +.page-header .ancestors a:hover { + opacity: 1; + text-decoration: underline; +} +.page-header .ancestors + .name { + margin-left: 15px; +} +.page-header p { + font-size: 20px; + margin-bottom: 0; + font-weight: 300; + line-height: 1.4; + color: #d0d0d0; +} +.page-header .container { + position: relative; +} +#topNavigation .dropdown-menu { + max-height: 640px; + max-height: calc(100vh - 62px); + overflow-y: auto; +} +@media (min-width: 768px) { + .page-header { + padding-top: 60px; + padding-bottom: 60px; + text-align: left; + } + .page-header .kind { + font-size: 80px; + line-height: 1; + } + .page-header h1 { + font-size: 60px; + line-height: 1; + } + .page-header .ancestors { + font-size: 20px; + } + .page-header p { + font-size: 24px; + } +} +dl.symbol dl.symbol { + margin-left: 15px; + margin-bottom: 15px; +} +.symbol-title h1, +.symbol-title h2, +.symbol-title h3, +.symbol-title h4, +.symbol-title h5 { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding-left: 50px; + text-indent: -50px; +} +.main-content .symbol-title h1, +.main-content .symbol-title h2 { + border-bottom: none; + margin-bottom: inherit; +} +.symbol-title .name-signature, +.symbol-title .signature-params { + color: #222; +} +.symbol-title .name-string, +.symbol-title .signature-param, +.symbol-title h4.event { + color: #c7254e; +} +.symbol-details { + overflow: hidden; +} +.symbol-title.collapsible-symbol { + cursor: pointer; +} +.symbol-title.collapsible-symbol .toggle-icon { + color: #337ab7; + text-indent: 0; +} +.symbol-title.collapsible-symbol:hover .toggle-icon { + opacity: 0.8; +} +.symbol-details.collapsible-symbol { + max-height: 0; +} +.symbol-details.collapsible-symbol.transition { + transition: max-height 0.4s ease-in; +} +.summary { + font-size: 15px; + font-weight: 400; + color: grey; +} +.signature-attribs, +.signature-new, +.signature-type { + color: #adadad; + font-size: smaller; +} +.anchored { + position: relative; +} +.anchor-link { + position: absolute; + left: -55px; + padding-right: 15px; + text-indent: 0; + display: inline-block; + min-width: 60px; + text-align: right; + opacity: 0; + visibility: hidden; + color: #999; +} +.anchor-link:hover { + color: #777; +} +.expanded .anchor-link, +h1:hover .anchor-link, +h2:hover .anchor-link, +h3:hover .anchor-link, +h4:hover .anchor-link { + opacity: 1; + visibility: visible; +} +.breadcrumb li a { + color: #337ab7; +} +.dummy-console { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 12px; + resize: vertical; + margin-bottom: 15px; +} +#lunr-search-footer .pagination { + margin: 0; +} +.lunr-search-results-page { + list-style: none; + padding: 0; + display: none; +} +.lunr-search-results-page.active { + display: block; +} +.lunr-search-results-page li { + list-style: none; + margin-bottom: 20px; +} +span.lunr-search-result-kind { + text-transform: capitalize; +} +a.lunr-search-result-title { + font-size: 14px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +a.lunr-search-result-title:hover { + text-decoration: underline; +} +p.lunr-search-result-url { + color: #006621; + font-size: 13px; + line-height: 16px; + margin: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +p.lunr-search-result-summary { + color: #999; + font-size: 13px; + line-height: 16px; + margin: 0; + overflow: hidden; + max-height: 48px; + text-overflow: ellipsis; +} +@media (min-width: 992px) { + .navbar-form { + width: 228px; + } +} +@media (min-width: 1200px) { + .navbar-form { + width: 278px; + } +} +.related-tutorials ul { + margin-top: 20px; +} +.related-tutorials ul li a { + font-size: 16px; + margin: 5px 0; + display: inline-block; +} +.toc.affix { + position: static; +} +.toc-nav { + margin-top: 5px; + padding-bottom: 10px; + max-height: 95%; + max-height: calc(100% - 2em); + overflow-y: auto; +} +.toc .nav > li > a { + display: block; + padding: 4px 4px 4px 36px; + text-indent: -20px; + font-size: 14px; + font-weight: 500; + color: #767676; +} +.toc .nav > li > a:focus, +.toc .nav > li > a:hover { + padding-left: 35px; + color: #337ab7; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #337ab7; +} +.toc .nav > li.active > a, +.toc .nav > li.active > a:focus, +.toc .nav > li.active > a:hover { + padding-left: 34px; + color: #337ab7; + background-color: transparent; + border-left: 2px solid #337ab7; +} +.toc .nav .nav { + display: none; + padding-bottom: 10px; +} +.toc .nav .nav > li > a { + font-size: 13px; + padding-left: 39px; + font-weight: 400; +} +.toc .nav .nav > li > a:focus, +.toc .nav .nav > li > a:hover { + padding-left: 38px; +} +.toc .nav .nav > li.active > a, +.toc .nav .nav > li.active > a:focus, +.toc .nav .nav > li.active > a:hover { + padding-left: 37px; +} +.toc .nav .nav .nav > li > a { + font-size: 12px; + padding-left: 44px; +} +.toc .nav .nav .nav > li > a:focus, +.toc .nav .nav .nav > li > a:hover { + padding-left: 43px; +} +.toc .nav .nav .nav > li.active > a, +.toc .nav .nav .nav > li.active > a:focus, +.toc .nav .nav .nav > li.active > a:hover { + padding-left: 42px; +} +.toc .nav .nav .nav .nav > li > a { + font-size: 12px; + padding-left: 49px; +} +.toc .nav .nav .nav .nav > li > a:focus, +.toc .nav .nav .nav .nav > li > a:hover { + padding-left: 48px; +} +.toc .nav .nav .nav .nav > li.active > a, +.toc .nav .nav .nav .nav > li.active > a:focus, +.toc .nav .nav .nav .nav > li.active > a:hover { + padding-left: 47px; +} +.toc .nav > li > a .name-require { + color: #767676; +} +.toc .nav > li > a > .ancestors > span { + color: #337ab7; +} +.toc .nav > li > a .signature-attribs { + font-weight: 400; +} +.toc .nav > li > a .name-signature, +.toc .nav > li > a .signature-params { + color: #000; +} +.toc .nav > li.event > a .name, +.toc .nav > li > a .name-string, +.toc .nav > li > a .signature-param { + color: #c7254e; +} +.back-to-top { + display: none; + padding: 4px 10px; + margin-top: 10px; + margin-left: 10px; + font-size: 12px; + font-weight: 500; + color: #999; + cursor: pointer; +} +.back-to-top:hover { + color: #337ab7; + text-decoration: none; +} +@media (min-width: 768px) { + .back-to-top { + display: block; + } +} +@media (min-width: 992px) { + .toc .nav > .active > ul { + display: block; + } + .toc.affix, + .toc.affix-bottom { + width: 213px; + } + .toc.affix { + position: fixed; + top: 67px; + height: calc(100% - 67px - 50px); + } + .toc.affix-bottom { + position: absolute; + } + .toc.affix .toc-nav, + .toc.affix-bottom .toc-nav { + margin-top: 0; + margin-bottom: 0; + } +} +@media (min-width: 1200px) { + .toc.affix, + .toc.affix-bottom { + width: 263px; + } +} +.access-filter { + text-align: right; + font-size: 12px; + padding: 8px 15px; + margin-top: 0; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; + color: #767676; +} +.breadcrumb + .access-filter { + margin-top: -25px; + margin-bottom: 0; +} +.access-filter .checkbox-inline input[type="checkbox"] { + margin: 1px 0 0 -17px; +} +.access-filter .checkbox-inline, +.access-filter .checkbox-inline:before { + color: #767676; +} +.access-filter .checkbox-inline.checked, +.access-filter .checkbox-inline:focus, +.access-filter .checkbox-inline:hover { + color: #337ab7; +} +.access-filter .checkbox-inline:before { + display: inline-block; + position: relative; + left: -25px; +} +.access-filter .checkbox-inline:first-of-type:before { + content: "Show -"; +} +.access-filter .checkbox-inline + .checkbox-inline:before { + content: "|"; +} diff --git a/__DOCS__/JSDocTemplate/.test/global.html b/__DOCS__/JSDocTemplate/.test/global.html index 99553ff..97cfe8d 100644 --- a/__DOCS__/JSDocTemplate/.test/global.html +++ b/__DOCS__/JSDocTemplate/.test/global.html @@ -1,199 +1,271 @@ - - - - - - Globals - - - - - - - - - - - -
-
-
- -
-
-

Type Definitions

-
-
-
-

SomeType

-
-
-
-
Description

Some global type.

-
-
Properties
- - - - - - - - - - - - - - - -
NameTypeDescription
somePropstring -
-
-
Details
- - -
- -
-
Object
-
-
- - - - - - - - - - - - - - - -
- - -
- - - - -
-
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + Globals + + + + + + + + + + + + +
+
+
+ +
+
+

Type Definitions

+
+
+
+

+ SomeType +

+
+
+
+
+
Description
+

Some global type.

+
+
+
Properties
+ + + + + + + + + + + + + + + +
NameTypeDescription
somePropstring
+
+
+
Details
+
+ +
+ +
+
+ Object +
+
+
+ + +
+ +
+

+ GlobalClass.js, + line 64 +

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/index.html b/__DOCS__/JSDocTemplate/.test/index.html index 30ff20d..74b4351 100644 --- a/__DOCS__/JSDocTemplate/.test/index.html +++ b/__DOCS__/JSDocTemplate/.test/index.html @@ -1,127 +1,291 @@ - - - - - - - FooDoc - - - - - - - - - - - -
-
-
-
-

NPM

-

Dependency Status devDependency Status Donate

-

FooDoc

FooDoc is a Bootstrap and Handlebars based template for JSDoc3. A big thanks must go out to DocStrap as it served as the inspiration for this project.

-

This project began as a simple modification of DocStrap. Removing the Bootswatch support in favor of my own CSS customizations but it ended up with me re-writing pretty much the entire template, even switching out the template engine to Handlebars.

-

Features

    -
  • Right side Table of Contents which auto hides on pages it's not required on.
  • -
  • Basic themeing is supported through the systemColor option and if required further customizations can be supplied using the stylesheets and scripts options.
  • -
  • Integrated offline search across all doclets and there members (excludes source files).
  • -
  • Syntax highlighting using Prism .
  • -
  • Breadcrumbs on every page for easy navigation.
  • -
  • Handlebars template engine using precompiled templates to generate documentation.
  • -
  • Extended tutorial configuration through the standard .json file approach supported by JSDoc allowing you to supply a structure as well as title and summary info for tutorials.
  • -
  • Configurable navbar links including support for larger systems by switching to list pages with the inlineNav option instead of the usual drop downs.
  • -
  • Responsive design, the generated documentation works across both desktop and mobile devices thanks to Bootstrap.
  • -
  • Makes use of the JSDoc @summary tag where appropriate, this tag now also supports markdown syntax.
  • -
-

What it looks like

As this started off as a DocStrap modification I've used it's fixtures code to generate the sample documentation so you can compare the differences between the two.

-

NOTE: The fixtures code doesn't make use of the @summary tag when describing it's members so it may look a little sparse.

- -

Ooooh, I want it! How do I get it?

If you manage your own version of jsdoc:

-
npm install foodoc

When using grunt, please look at grunt-jsdoc which you can use with FooDoc.

-

Command line example

jsdoc -c path/to/conf.json -t ./node_modules/foodoc/template -R README.md -r .

The -c sets the config, the options you can supply in the templates object are listed below in the options.

-

The -t sets the template. This is the option you need to set to get the FooDoc template to be used.

-

The -R sets a markdown file to be the front page of the documentation.

-

The -r tells jsdoc to run recursively.

-

The . says from current directory.

-

Configuring the template

FooDoc ships with a conf.json file in the template/ directory. It is just a regular old JSDoc configuration file, but with the following new options:

-
"templates": {
+
+
+
+  
+    
+    
+    FooDoc
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+
+
+
+
+

+ NPM +

+

+ Dependency Status + devDependency Status + Donate +

+

FooDoc

+

+ FooDoc is a + Bootstrap + and Handlebars based template for + JSDoc3. A big thanks must go out to + DocStrap as it served as the inspiration for this + project. +

+

+ This project began as a simple modification of DocStrap. Removing the Bootswatch support in favor of my + own CSS customizations but it ended up with me re-writing pretty much the entire template, even + switching out the template engine to Handlebars. +

+

Features

+
    +
  • Right side Table of Contents which auto hides on pages it's not required on.
  • +
  • + Basic themeing is supported through the + systemColor option and if required further customizations can be supplied using the + stylesheets and scripts options. +
  • +
  • Integrated offline search across all doclets and there members (excludes source files).
  • +
  • + Syntax highlighting using + Prism . +
  • +
  • Breadcrumbs on every page for easy navigation.
  • +
  • Handlebars template engine using precompiled templates to generate documentation.
  • +
  • + Extended tutorial configuration through the standard + .json file approach supported by JSDoc allowing you to supply a structure as well as + title and summary info for tutorials. +
  • +
  • + Configurable navbar links including support for larger systems by switching to list pages with the + inlineNav option instead of the usual drop downs. +
  • +
  • + Responsive design, the generated documentation works across both desktop and mobile devices thanks to + Bootstrap. +
  • +
  • + Makes use of the JSDoc @summary tag where appropriate, this tag now also supports + markdown syntax. +
  • +
+

What it looks like

+

+ As this started off as a DocStrap modification I've used it's + fixtures code to generate the sample documentation so you can compare the differences + between the two. +

+

+ NOTE: The fixtures code doesn't make use of the @summary tag + when describing it's members so it may look a little sparse. +

+ +

Ooooh, I want it! How do I get it?

+

If you manage your own version of jsdoc:

+
npm install foodoc
+

+ When using grunt, please look at + grunt-jsdoc + which you can use with FooDoc. +

+

Command line example

+
jsdoc -c path/to/conf.json -t ./node_modules/foodoc/template -R README.md -r .
+

+ The -c sets the config, the options you can supply in the templates object are listed below + in the options. +

+

+ The -t sets the template. This is the option you need to set to get the FooDoc template to + be used. +

+

The -R sets a markdown file to be the front page of the documentation.

+

The -r tells jsdoc to run recursively.

+

The . says from current directory.

+

Configuring the template

+

+ FooDoc ships with a conf.json file in the template/ directory. It is just a regular old + JSDoc configuration file, but with the + following new options: +

+
"templates": {
     "systemName"            : "{string}",
     "systemSummary"         : "{string}",
     "systemLogo"            : "{string}",
@@ -146,18 +310,70 @@ 

Configuring the template

FooDoc ships with a conf.json f "favicon" : "{string}", "stylesheets" : "{array.<string>}", "scripts" : "{array.<string>}" -}

Options

    -
  • systemName - "FooDoc"
    The name of the system being documented. This value is used to generate the home link in the navbar and the page title for the generated README page.
  • -
  • systemSummary - "A Bootstrap and Handlebars based JSDoc3 template."
    The short summary description of the system being documented. This is used as part of the page title for the generated README page.
  • -
  • systemLogo - ""
    A small 40x40 pixel image to used in the navbar along with the systemName to create the home link.
  • -
  • systemColor - ""
    The primary color used to generate the documentation. This changes the background color of the jumbotron-esque headers on every page, the primary callout border and header colors, the TOC link colors and various other small highlights.
  • -
  • footer - ""
    Additional content to place in the footer element of each page before the copyright and default generated by messages. This can contain HTML.
  • -
  • copyright - "FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects."
    A copyright message to display in the footer of each page throughout the documentation.
  • -
  • includeDate - true
    Whether or not the date is included as part of the generated by message.
  • -
  • dateFormat - Do MMM YYYY
    If includeDate is true this is the format used to display the date. This makes use of moment.js so any format it supports should be supported here.
  • -
  • inlineNav - false
    If your system is quite large the navbar drop downs just don't look good, setting this option to true changes these drop downs to instead just be a link to a list page.
  • -
  • inverseNav - true
    Bootstrap navbars support an inverse mode, this toggles that option for the documentation navbar with true being the dark version.
  • -
  • navMembers
    This option allows you to specify which kinds of documents appear in the navbar, give them a title and provide a short summary which is then used as part of the inlineNav option to generate the list pages. The following shows the default values for this option, you can remove from this array but cannot add new kinds without altering the template. If no documents are registered for a specific kind it is not added to the navbar.
    [
    +}
    +

    Options

    +
      +
    • + systemName - "FooDoc"
      The name of the system being documented. This value is used to generate the home link + in the navbar and the page title for the generated README page. +
    • +
    • + systemSummary - "A Bootstrap and Handlebars based JSDoc3 template."
      The short summary description of the system being documented. This is used as part of the page + title for the generated README page. +
    • +
    • + systemLogo - ""
      A small 40x40 pixel image to used in the navbar along with the systemName to + create the home link. +
    • +
    • + systemColor - ""
      The primary color used to generate the documentation. This changes the background color of the + jumbotron-esque headers on every page, the primary callout border and header colors, the TOC link + colors and various other small highlights. +
    • +
    • + footer - ""
      Additional content to place in the footer element of each page before the + copyright and default generated by messages. This can contain HTML. +
    • +
    • + copyright - + "FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects."
      A copyright message to display in the footer of each page throughout the documentation. +
    • +
    • + includeDate - true
      Whether or not the date is included as part of the generated by message. +
    • +
    • + dateFormat - Do MMM YYYY
      If includeDate is true this is the format used to display the date. This makes use + of moment.js so any format it supports should be supported here. +
    • +
    • + inlineNav - false
      If your system is quite large the navbar drop downs just don't look good, setting this option + to true changes these drop downs to instead just be a link to a list page. +
    • +
    • + inverseNav - true
      Bootstrap navbars support an inverse mode, this toggles that option for the documentation + navbar with true being the dark version. +
    • +
    • + navMembers
      This option allows you to specify which kinds of documents appear in + the navbar, give them a title and provide a short summary which is then used as part of the + inlineNav option to generate the list pages. The following shows the default values for + this option, you can remove from this array but cannot add new kinds without altering the template. If + no documents are registered for a specific kind it is not added to the navbar. +
      [
           {"kind": "class", "title": "Classes", "summary": "All documented classes."},
           {"kind": "external", "title": "Externals", "summary": "All documented external members."},
           {"kind": "global", "title": "Globals", "summary": "All documented globals."},
      @@ -166,35 +382,120 @@ 

      Configuring the template

      FooDoc ships with a conf.json f {"kind": "module", "title": "Modules", "summary": "All documented modules."}, {"kind": "namespace", "title": "Namespaces", "summary": "All documented namespaces."}, {"kind": "tutorial", "title": "Tutorials", "summary": "All available tutorials."} -]

    • -
    • outputSourceFiles - true
      Whether or not to output pretty printed source file documentation that is linked to from other documents.
    • -
    • outputSourcePath - true
      When outputSourceFiles is false, you may still want to name the file even without a link to the pretty printed output. Set this to true when outputSourceFiles is false. outputSourceFiles when true takes precedence over this setting.
    • -
    • linenums - true
      When true, line numbers will appear in any pretty printed source code blocks. If outputSourceFiles is true this will add an additional link to all documented members pointing to the exact line number in the pretty printed source file the documentation was pulled from.
    • -
    • showTableOfContents - true
      When true, a TOC is generated from all H1, H2, H3 and H4 headings in the generated pages, this includes the README and tutorial pages. If you want to disable this for specific tutorial pages you can set this same option per tutorial in the extended tutorial configuration.
    • -
    • showAccessFilter - true
      When true, a checkbox list is displayed allowing the user to toggle the visibility of inherited, public, protected and private symbols of the current doclet. Each checkbox will only be displayed if the doclet contains at least one symbol of that type. If there is only a single type available across the entire doclet the filter is not displayed at all.
    • -
    • analytics - null
      Adds a Google Analytics code block to the template output
      e.g. "analytics":{"ua":"UA-XXXXX-XXX", "domain":"XXXX"}

      -
        -
      • ua The google agent (see Google Analytics help for details)
      • -
      • domain The domain being served. (see Google Analytics help for details)
      • -
      -
    • -
    • collapseSymbols - true
      When true, symbols in generated pages (methods, members, type definitions, etc.) are collapsed so only there title and summary are visible. You can then click on them to reveal more detailed information.

      -
    • -
    • methodHeadingReturns - true
      When true, method headings will contain the return type if one exists.
    • -
    • sort - "linenum, longname, version, since"
      Specifies the sort order of the symbols on a page. They will still be grouped under there own headings (Classes, Members, Methods, etc.) but within these groups they are sorted using the supplied value. By default this sorts symbols first by where they were found in the original source code, then by there longname, then by there version and lastly by there since tag.
    • -
    • search - true
      Whether or not to enable the lunr search component.
    • -
    • favicon - null
      An image or favicon that will be used as favicon.
    • -
    • stylesheets - []
      An array of stylesheet urls to include in every page.
    • -
    • scripts - []
      An array of script urls to include in every page.
    • -
    -

    Extended tutorial configuration

    JSDoc supports providing a .json file in your tutorials directory to configure the hierarchical structure and title for tutorials. This template adds two new options to each tutorial in this file.

    -
      -
    • summary
      A short summary of the tutorial which is used in various places throughout the documentation, most notably in the page header of the tutorial itself.
    • -
    • showTableOfContents
      A boolean value indicating whether or not to generate the Table of Contents for this specific tutorial.
    • -
    -

    The following shows what the tutorials.json in the fixtures test code contains.

    -

    NOTE: The array based syntax for child tutorials is not supported at present and children must be supplied as properties of an object.

    -
    {
    +]
    +
  • +
  • + outputSourceFiles - true
    Whether or not to output pretty printed source file documentation that is linked to from other + documents. +
  • +
  • + outputSourcePath - true
    When outputSourceFiles is false, you may still want to name the file + even without a link to the pretty printed output. Set this to true when + outputSourceFiles is false. outputSourceFiles when + true takes precedence over this setting. +
  • +
  • + linenums - true
    When true, line numbers will appear in any pretty printed source code blocks. If + outputSourceFiles is true this will add an additional link to all documented + members pointing to the exact line number in the pretty printed source file the documentation was + pulled from. +
  • +
  • + showTableOfContents - true
    When true, a TOC is generated from all H1, H2, + H3 and H4 headings in the generated pages, this includes the README and + tutorial pages. If you want to disable this for specific tutorial pages you can set this same option + per tutorial in the extended tutorial configuration. +
  • +
  • + showAccessFilter - true
    When true, a checkbox list is displayed allowing the user to toggle the visibility + of inherited, public, protected and private symbols of the current doclet. Each checkbox will only be + displayed if the doclet contains at least one symbol of that type. If there is only a single type + available across the entire doclet the filter is not displayed at all. +
  • +
  • +

    + analytics - null
    Adds a + Google Analytics + code block to the template output
    e.g. + "analytics":{"ua":"UA-XXXXX-XXX", + "domain":"XXXX"} +

    +
      +
    • ua The google agent (see Google Analytics help for details)
    • +
    • domain The domain being served. (see Google Analytics help for details)
    • +
    +
  • +
  • +

    + collapseSymbols - true
    When true, symbols in generated pages (methods, members, type definitions, etc.) + are collapsed so only there title and summary are visible. You can then click on them to reveal more + detailed information. +

    +
  • +
  • + methodHeadingReturns - true
    When true, method headings will contain the return type if one exists. +
  • +
  • + sort - "linenum, longname, version, since"
    Specifies the sort order of the symbols on a page. They will still be grouped under there own + headings (Classes, Members, Methods, etc.) but within these groups they are sorted using the supplied + value. By default this sorts symbols first by where they were found in the original source code, then + by there longname, then by there version and lastly by there since tag. +
  • +
  • + search - true
    Whether or not to enable the lunr search component. +
  • +
  • + favicon - null
    An image or favicon that will be used as favicon. +
  • +
  • + stylesheets - []
    An array of stylesheet urls to include in every page. +
  • +
  • + scripts - []
    An array of script urls to include in every page. +
  • +
+

Extended tutorial configuration

+

+ JSDoc supports providing a .json file in your tutorials directory + to configure the hierarchical structure and title for tutorials. This template adds two new options to + each tutorial in this file. +

+
    +
  • + summary
    A short summary of the tutorial which is used in various places + throughout the documentation, most notably in the page header of the tutorial itself. +
  • +
  • + showTableOfContents
    A boolean value indicating whether or not to generate the + Table of Contents for this specific tutorial. +
  • +
+

+ The following shows what the tutorials.json in the fixtures test code + contains. +

+

+ NOTE: The array based syntax for child tutorials is not supported at present and + children must be supplied as properties of an object. +

+
{
   "brush-teeth": {
     "title": "Brush Teeth",
     "summary": "How to brush your teeth!",
@@ -210,29 +511,87 @@ 

Extended tutorial configuration

Prism to provide syntax highlighting and supports a couple of ways to specify which language to use.

-
    -
  • The standard markdown syntax is supported.

    -
    ```html
    +}
    +

    Syntax highlighting

    +

    + FooDoc uses + Prism to provide syntax highlighting and supports a + couple of ways to specify which language to use. +

    +
      +
    • +

      The standard markdown syntax is supported.

      +
      +```html
       <html></html>
      -```
      -
    • -
    • Or when using an @example tag in your comments you can add a custom inner tag {@lang languageName} where languageName is one of the default languages supported by Prism (Markup, CSS, C-Like and JavaScript languages are supported by default). You can add this tag anywhere within an @example tags body but keep in mind that there is no white-space processing performed when it is removed prior to rendering.

      -
      /**
      +```
      +
    • +
    • +

      + Or when using an @example tag in your comments you can add a custom inner tag + {@lang languageName} where languageName is one of the default languages + supported by Prism (Markup, CSS, C-Like and JavaScript languages are supported by default). You can + add this tag anywhere within an @example tags body but keep in mind that there is no + white-space processing performed when it is removed prior to rendering. +

      +
      /**
        * @example {@lang html}<html></html>
      - */
    • -
    -

    If you need to use a language provided by a Prism plugin you will need to fork the template and add in the specific language yourself. Take a look at the Prism documentation to see a full list of all 119 supported languages.

    -

    FAQ

    Why another template?

    Over the years I have tried quite a few templates available for JSDoc and none of them produced a look I was quite happy with. Some got close like DocStrap, but I still wasn't quite satisfied so I did what all developers do eventually, roll their own. I really liked the clean look of the Bootstrap 3 documentation so I used it as base for the layout and styling for this template.

    -

    Why Handlebars?

    Personal preference really, Underscore templates work great but due to there ability to have basically any JavaScript in them I've noticed a lot logic which should be handled elsewhere creep into them overtime. It's simply easier to hack it into the template than find where it should be implemented as part of the post processing.

    -

    What's different from DocStrap's search?

    The lunr search implementation in DocStrap performs all the indexing in the browser using a hidden iframe, this was done to allow the search to work offline when viewing the documentation via the file:// protocol. It does however have the drawback of loading and then indexing what could potentially be a large numbers of documents, on every page load.

    -

    While this works I took a different approach and decided to generate the search index and store as part of the documentation process and output the results in two files lunr-data.json and lunr-data.js. These two files are then consumed by the search component when required. The lunr-data.json file is fetched via ajax request if the documentation is served via http:// or https:// protocols while the lunr-data.js file is simply included into the page when using the file:// protocol as you can't perform ajax requests. This ultimately provides us with two primary benefits over DocStrap's implementation:

    -
      -
    1. All indexing of documents is performed only once, when the documentation itself is generated. Due to creating the index directly from the JSDoc doclets it contains more detailed information, including information on members, methods and type definitions, leading to better search results where you can click on a method name and be taken directly to it's documentation.
    2. -
    3. The index and store information is only loaded into the page when a user performs a search, this greatly improves load speeds.
    4. -
    -

    The following shows the lunr index fields implemented by this template:

    -
    var index = lunr(function(){
    + */
    +
  • +
+

+ If you need to use a language provided by a Prism plugin you will need to fork the template and add in + the specific language yourself. Take a look at the + Prism documentation + to see a full list of all 119 supported languages. +

+

FAQ

+

Why another template?

+

+ Over the years I have tried quite a few templates available for JSDoc and none of them produced a look I + was quite happy with. Some got close like DocStrap, but I still wasn't quite satisfied so I did what all + developers do eventually, roll their own. I really liked the clean look of the Bootstrap 3 documentation + so I used it as base for the layout and styling for this template. +

+

Why Handlebars?

+

+ Personal preference really, Underscore templates work great but due to there ability to have basically + any JavaScript in them I've noticed a lot logic which should be handled elsewhere creep into them + overtime. It's simply easier to hack it into the template than find where it should be implemented as + part of the post processing. +

+

What's different from DocStrap's search?

+

+ The lunr search implementation in DocStrap performs all the indexing in + the browser using a hidden iframe, this was done to allow the search to work offline when viewing the + documentation via the file:// protocol. It does however have the drawback of loading and + then indexing what could potentially be a large numbers of documents, on every page load. +

+

+ While this works I took a different approach and decided to generate the search index and store as part + of the documentation process and output the results in two files + lunr-data.json and lunr-data.js. These two files are then consumed by the + search component when required. The lunr-data.json file is fetched via ajax request if the + documentation is served via http:// or https:// protocols while the + lunr-data.js file is simply included into the page when using the + file:// protocol as you can't perform ajax requests. This ultimately provides us with two + primary benefits over DocStrap's implementation: +

+
    +
  1. + All indexing of documents is performed only once, when the documentation itself is generated. Due to + creating the index directly from the JSDoc doclets it contains more detailed information, including + information on members, methods and type definitions, leading to better search results where you can + click on a method name and be taken directly to it's documentation. +
  2. +
  3. + The index and store information is only loaded into the page when a user performs a search, this + greatly improves load speeds. +
  4. +
+

The following shows the lunr index fields implemented by this template:

+
var index = lunr(function(){
     this.field('longname', {boost: 1000});
     this.field('name', {boost: 500});
     this.field('tags', {boost: 300});
@@ -242,95 +601,178 @@ 

What's different from DocStrap's search?

The -

-
-
-
- - - - - - - - - - - - - \ No newline at end of file +});
+
    +
  • + longname
    This is basically a doclet id and is the fully qualified name of a + documented symbol. e.g. MyApi.utils.fetch or MyApi.Class#fetch. This has the + highest weighting of 1000 as if someone types in the exact longname it should be the first result! +
  • +
  • + name
    This is the short or "friendly" name of a doclet, using the two + examples from above (MyApi.utils.fetch or MyApi.Class#fetch) they would both + have the same name of fetch. +
  • +
  • + tags
    This is a space delimited string of any tags generated for the doclet. At + present this simply provides multiple variations of the longname to aid in searching, for example the + longname MyApi.utils#fetch would be added to the tags as the following; + utils#fetch fetch. +
  • +
  • + kind
    This is the kind or type of the doclet (class, namespace, function, etc.). +
  • +
  • title
    This is the page title the doclet uses when generating a page.
  • +
  • + summary
    This is the HTML sanitized doclet summary, in the case of a tutorial or + the readme this is the summary value supplied through either the extended configuration or options. +
  • +
  • description
    This is the HTML sanitized doclet description.
  • +
  • + body
    This is the full text of the main content section of the generated HTML for + the doclet. Any matches against this have the lowest possible weighting. +
  • +
+

Why Prism instead of Sunlight?

+

+ Quite simply Sunlight is no longer maintained and while it does work I prefer Prism which is actively + maintained and follows HTML5 standards. +

+

To Do

+
    +
  • + Refactor and document the template source code. Now that I know how it all works I can slim down + source code and then heavily document it so I can use it as the example documentation. +
  • +
+

Changelog

+

+ All releases prior to 1.0.0 are considered pre-release, i.e. I'm not finished changing stuff yet so + anything can happen ;) +

+

0.0.9

+
    +
  • Fixed issue with the footer option not rendering HTML as it was intended.
  • +
  • Fixed the missing global.html issue.
  • +
  • Updated the copyright option to also allow HTML in it's content.
  • +
  • + Updated the _navbar.hbs so that if an item has no members it is simply rendered as a link + instead of an empty dropdown. +
  • +
  • + Updated the base CSS to apply a background color to the + <html/> element that matches the footer. This stops the page looking 'incomplete' + or 'broken' as there is no longer any whitespace below the footer. +
  • +
+

0.0.8

+
    +
  • + Updated the navbar dropdowns and the table of contents to handle long lists. If the list exceeds the + viewport it now displays a scrollbar. (@mistic100) +
  • +
  • + Fixed missing Google Analytics code in the + _layout.hbs. (@mistic100) +
  • +
  • + Added the favicon option allowing you to supply a path to an image or icon to use as the + favicon for the documentation. (@mistic100) +
  • +
  • + Added the showAccessFilter option which allows users to filter the symbols of a doclet in + real-time by if they are inherited, public, protected or private. +
  • +
+

0.0.7

+
    +
  • Fixed Prism CSS conflict with .namespace class.
  • +
  • + Updated Gruntfile to compile and minify all used prism files (including customized plugins) into + single includes. +
  • +
  • + Added in the Prism Normalize Whitespace plugin to perform some additional processing to clean up any + extra whitespace in examples. +
  • +
+

0.0.6

+
    +
  • + Replaced Sunlight syntax highlighter with Prism as it is maintained and it's just generally better. +
  • +
+

0.0.5

+
    +
  • Updated TOC to align with crumbs.
  • +
  • Fixed anchor-links not showing on hover.
  • +
  • Updated the search input size to match the TOC.
  • +
+

0.0.4

+
    +
  • + Added missing {@run } javascript and css as well as some additional styling for related tutorials. +
  • +
+

0.0.3

+
    +
  • Fixed page symbols not generating details correctly when displayed as primary header.
  • +
+

0.0.2

+
    +
  • Fixed missing moment.js dependency in the npm package.
  • +
  • Added .npmignore to exclude the generated examples directory.
  • +
  • + Updated the lunrHelper.js to write files directly to the output directory instead of to the + template/static one and then copying it across. +
  • +
+

0.0.1

+
    +
  • Initial check in of template.
  • +
+
+
+
+
+ +
+
+
+
+ +
+ Documentation generated by + JSDoc 3.5.5 on 1st May 2018 using the + FooDoc template. +
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/js/bootstrap.min.js b/__DOCS__/JSDocTemplate/.test/js/bootstrap.min.js index 9bcd2fc..79b3459 100644 --- a/__DOCS__/JSDocTemplate/.test/js/bootstrap.min.js +++ b/__DOCS__/JSDocTemplate/.test/js/bootstrap.min.js @@ -3,5 +3,1412 @@ * Copyright 2011-2016 Twitter, Inc. * Licensed under the MIT license */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file +if ("undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); ++(function (a) { + "use strict"; + var b = a.fn.jquery.split(" ")[0].split("."); + if ((b[0] < 2 && b[1] < 9) || (1 == b[0] && 9 == b[1] && b[2] < 1) || b[0] > 3) + throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4"); +})(jQuery), + +(function (a) { + "use strict"; + function b() { + var a = document.createElement("bootstrap"), + b = { + WebkitTransition: "webkitTransitionEnd", + MozTransition: "transitionend", + OTransition: "oTransitionEnd otransitionend", + transition: "transitionend", + }; + for (var c in b) if (void 0 !== a.style[c]) return { end: b[c] }; + return !1; + } + (a.fn.emulateTransitionEnd = function (b) { + var c = !1, + d = this; + a(this).one("bsTransitionEnd", function () { + c = !0; + }); + var e = function () { + c || a(d).trigger(a.support.transition.end); + }; + return setTimeout(e, b), this; + }), + a(function () { + (a.support.transition = b()), + a.support.transition && + (a.event.special.bsTransitionEnd = { + bindType: a.support.transition.end, + delegateType: a.support.transition.end, + handle: function (b) { + if (a(b.target).is(this)) return b.handleObj.handler.apply(this, arguments); + }, + }); + }); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + return this.each(function () { + var c = a(this), + e = c.data("bs.alert"); + e || c.data("bs.alert", (e = new d(this))), "string" == typeof b && e[b].call(c); + }); + } + var c = '[data-dismiss="alert"]', + d = function (b) { + a(b).on("click", c, this.close); + }; + (d.VERSION = "3.3.7"), + (d.TRANSITION_DURATION = 150), + (d.prototype.close = function (b) { + function c() { + g.detach().trigger("closed.bs.alert").remove(); + } + var e = a(this), + f = e.attr("data-target"); + f || ((f = e.attr("href")), (f = f && f.replace(/.*(?=#[^\s]*$)/, ""))); + var g = a("#" === f ? [] : f); + b && b.preventDefault(), + g.length || (g = e.closest(".alert")), + g.trigger((b = a.Event("close.bs.alert"))), + b.isDefaultPrevented() || + (g.removeClass("in"), + a.support.transition && g.hasClass("fade") + ? g.one("bsTransitionEnd", c).emulateTransitionEnd(d.TRANSITION_DURATION) + : c()); + }); + var e = a.fn.alert; + (a.fn.alert = b), + (a.fn.alert.Constructor = d), + (a.fn.alert.noConflict = function () { + return (a.fn.alert = e), this; + }), + a(document).on("click.bs.alert.data-api", c, d.prototype.close); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data("bs.button"), + f = "object" == typeof b && b; + e || d.data("bs.button", (e = new c(this, f))), "toggle" == b ? e.toggle() : b && e.setState(b); + }); + } + var c = function (b, d) { + (this.$element = a(b)), (this.options = a.extend({}, c.DEFAULTS, d)), (this.isLoading = !1); + }; + (c.VERSION = "3.3.7"), + (c.DEFAULTS = { loadingText: "loading..." }), + (c.prototype.setState = function (b) { + var c = "disabled", + d = this.$element, + e = d.is("input") ? "val" : "html", + f = d.data(); + (b += "Text"), + null == f.resetText && d.data("resetText", d[e]()), + setTimeout( + a.proxy(function () { + d[e](null == f[b] ? this.options[b] : f[b]), + "loadingText" == b + ? ((this.isLoading = !0), d.addClass(c).attr(c, c).prop(c, !0)) + : this.isLoading && ((this.isLoading = !1), d.removeClass(c).removeAttr(c).prop(c, !1)); + }, this), + 0 + ); + }), + (c.prototype.toggle = function () { + var a = !0, + b = this.$element.closest('[data-toggle="buttons"]'); + if (b.length) { + var c = this.$element.find("input"); + "radio" == c.prop("type") + ? (c.prop("checked") && (a = !1), b.find(".active").removeClass("active"), this.$element.addClass("active")) + : "checkbox" == c.prop("type") && + (c.prop("checked") !== this.$element.hasClass("active") && (a = !1), this.$element.toggleClass("active")), + c.prop("checked", this.$element.hasClass("active")), + a && c.trigger("change"); + } else + this.$element.attr("aria-pressed", !this.$element.hasClass("active")), this.$element.toggleClass("active"); + }); + var d = a.fn.button; + (a.fn.button = b), + (a.fn.button.Constructor = c), + (a.fn.button.noConflict = function () { + return (a.fn.button = d), this; + }), + a(document) + .on("click.bs.button.data-api", '[data-toggle^="button"]', function (c) { + var d = a(c.target).closest(".btn"); + b.call(d, "toggle"), + a(c.target).is('input[type="radio"], input[type="checkbox"]') || + (c.preventDefault(), + d.is("input,button") + ? d.trigger("focus") + : d.find("input:visible,button:visible").first().trigger("focus")); + }) + .on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function (b) { + a(b.target) + .closest(".btn") + .toggleClass("focus", /^focus(in)?$/.test(b.type)); + }); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data("bs.carousel"), + f = a.extend({}, c.DEFAULTS, d.data(), "object" == typeof b && b), + g = "string" == typeof b ? b : f.slide; + e || d.data("bs.carousel", (e = new c(this, f))), + "number" == typeof b ? e.to(b) : g ? e[g]() : f.interval && e.pause().cycle(); + }); + } + var c = function (b, c) { + (this.$element = a(b)), + (this.$indicators = this.$element.find(".carousel-indicators")), + (this.options = c), + (this.paused = null), + (this.sliding = null), + (this.interval = null), + (this.$active = null), + (this.$items = null), + this.options.keyboard && this.$element.on("keydown.bs.carousel", a.proxy(this.keydown, this)), + "hover" == this.options.pause && + !("ontouchstart" in document.documentElement) && + this.$element + .on("mouseenter.bs.carousel", a.proxy(this.pause, this)) + .on("mouseleave.bs.carousel", a.proxy(this.cycle, this)); + }; + (c.VERSION = "3.3.7"), + (c.TRANSITION_DURATION = 600), + (c.DEFAULTS = { interval: 5e3, pause: "hover", wrap: !0, keyboard: !0 }), + (c.prototype.keydown = function (a) { + if (!/input|textarea/i.test(a.target.tagName)) { + switch (a.which) { + case 37: + this.prev(); + break; + case 39: + this.next(); + break; + default: + return; + } + a.preventDefault(); + } + }), + (c.prototype.cycle = function (b) { + return ( + b || (this.paused = !1), + this.interval && clearInterval(this.interval), + this.options.interval && + !this.paused && + (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)), + this + ); + }), + (c.prototype.getItemIndex = function (a) { + return (this.$items = a.parent().children(".item")), this.$items.index(a || this.$active); + }), + (c.prototype.getItemForDirection = function (a, b) { + var c = this.getItemIndex(b), + d = ("prev" == a && 0 === c) || ("next" == a && c == this.$items.length - 1); + if (d && !this.options.wrap) return b; + var e = "prev" == a ? -1 : 1, + f = (c + e) % this.$items.length; + return this.$items.eq(f); + }), + (c.prototype.to = function (a) { + var b = this, + c = this.getItemIndex((this.$active = this.$element.find(".item.active"))); + if (!(a > this.$items.length - 1 || a < 0)) + return this.sliding + ? this.$element.one("slid.bs.carousel", function () { + b.to(a); + }) + : c == a + ? this.pause().cycle() + : this.slide(a > c ? "next" : "prev", this.$items.eq(a)); + }), + (c.prototype.pause = function (b) { + return ( + b || (this.paused = !0), + this.$element.find(".next, .prev").length && + a.support.transition && + (this.$element.trigger(a.support.transition.end), this.cycle(!0)), + (this.interval = clearInterval(this.interval)), + this + ); + }), + (c.prototype.next = function () { + if (!this.sliding) return this.slide("next"); + }), + (c.prototype.prev = function () { + if (!this.sliding) return this.slide("prev"); + }), + (c.prototype.slide = function (b, d) { + var e = this.$element.find(".item.active"), + f = d || this.getItemForDirection(b, e), + g = this.interval, + h = "next" == b ? "left" : "right", + i = this; + if (f.hasClass("active")) return (this.sliding = !1); + var j = f[0], + k = a.Event("slide.bs.carousel", { relatedTarget: j, direction: h }); + if ((this.$element.trigger(k), !k.isDefaultPrevented())) { + if (((this.sliding = !0), g && this.pause(), this.$indicators.length)) { + this.$indicators.find(".active").removeClass("active"); + var l = a(this.$indicators.children()[this.getItemIndex(f)]); + l && l.addClass("active"); + } + var m = a.Event("slid.bs.carousel", { + relatedTarget: j, + direction: h, + }); + return ( + a.support.transition && this.$element.hasClass("slide") + ? (f.addClass(b), + f[0].offsetWidth, + e.addClass(h), + f.addClass(h), + e + .one("bsTransitionEnd", function () { + f.removeClass([b, h].join(" ")).addClass("active"), + e.removeClass(["active", h].join(" ")), + (i.sliding = !1), + setTimeout(function () { + i.$element.trigger(m); + }, 0); + }) + .emulateTransitionEnd(c.TRANSITION_DURATION)) + : (e.removeClass("active"), f.addClass("active"), (this.sliding = !1), this.$element.trigger(m)), + g && this.cycle(), + this + ); + } + }); + var d = a.fn.carousel; + (a.fn.carousel = b), + (a.fn.carousel.Constructor = c), + (a.fn.carousel.noConflict = function () { + return (a.fn.carousel = d), this; + }); + var e = function (c) { + var d, + e = a(this), + f = a(e.attr("data-target") || ((d = e.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, ""))); + if (f.hasClass("carousel")) { + var g = a.extend({}, f.data(), e.data()), + h = e.attr("data-slide-to"); + h && (g.interval = !1), b.call(f, g), h && f.data("bs.carousel").to(h), c.preventDefault(); + } + }; + a(document) + .on("click.bs.carousel.data-api", "[data-slide]", e) + .on("click.bs.carousel.data-api", "[data-slide-to]", e), + a(window).on("load", function () { + a('[data-ride="carousel"]').each(function () { + var c = a(this); + b.call(c, c.data()); + }); + }); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + var c, + d = b.attr("data-target") || ((c = b.attr("href")) && c.replace(/.*(?=#[^\s]+$)/, "")); + return a(d); + } + function c(b) { + return this.each(function () { + var c = a(this), + e = c.data("bs.collapse"), + f = a.extend({}, d.DEFAULTS, c.data(), "object" == typeof b && b); + !e && f.toggle && /show|hide/.test(b) && (f.toggle = !1), + e || c.data("bs.collapse", (e = new d(this, f))), + "string" == typeof b && e[b](); + }); + } + var d = function (b, c) { + (this.$element = a(b)), + (this.options = a.extend({}, d.DEFAULTS, c)), + (this.$trigger = a( + '[data-toggle="collapse"][href="#' + b.id + '"],[data-toggle="collapse"][data-target="#' + b.id + '"]' + )), + (this.transitioning = null), + this.options.parent + ? (this.$parent = this.getParent()) + : this.addAriaAndCollapsedClass(this.$element, this.$trigger), + this.options.toggle && this.toggle(); + }; + (d.VERSION = "3.3.7"), + (d.TRANSITION_DURATION = 350), + (d.DEFAULTS = { toggle: !0 }), + (d.prototype.dimension = function () { + var a = this.$element.hasClass("width"); + return a ? "width" : "height"; + }), + (d.prototype.show = function () { + if (!this.transitioning && !this.$element.hasClass("in")) { + var b, + e = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"); + if (!(e && e.length && ((b = e.data("bs.collapse")), b && b.transitioning))) { + var f = a.Event("show.bs.collapse"); + if ((this.$element.trigger(f), !f.isDefaultPrevented())) { + e && e.length && (c.call(e, "hide"), b || e.data("bs.collapse", null)); + var g = this.dimension(); + this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded", !0), + this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), + (this.transitioning = 1); + var h = function () { + this.$element.removeClass("collapsing").addClass("collapse in")[g](""), + (this.transitioning = 0), + this.$element.trigger("shown.bs.collapse"); + }; + if (!a.support.transition) return h.call(this); + var i = a.camelCase(["scroll", g].join("-")); + this.$element + .one("bsTransitionEnd", a.proxy(h, this)) + .emulateTransitionEnd(d.TRANSITION_DURATION) + [g](this.$element[0][i]); + } + } + } + }), + (d.prototype.hide = function () { + if (!this.transitioning && this.$element.hasClass("in")) { + var b = a.Event("hide.bs.collapse"); + if ((this.$element.trigger(b), !b.isDefaultPrevented())) { + var c = this.dimension(); + this.$element[c](this.$element[c]())[0].offsetHeight, + this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), + this.$trigger.addClass("collapsed").attr("aria-expanded", !1), + (this.transitioning = 1); + var e = function () { + (this.transitioning = 0), + this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse"); + }; + return a.support.transition + ? void this.$element[c](0) + .one("bsTransitionEnd", a.proxy(e, this)) + .emulateTransitionEnd(d.TRANSITION_DURATION) + : e.call(this); + } + } + }), + (d.prototype.toggle = function () { + this[this.$element.hasClass("in") ? "hide" : "show"](); + }), + (d.prototype.getParent = function () { + return a(this.options.parent) + .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') + .each( + a.proxy(function (c, d) { + var e = a(d); + this.addAriaAndCollapsedClass(b(e), e); + }, this) + ) + .end(); + }), + (d.prototype.addAriaAndCollapsedClass = function (a, b) { + var c = a.hasClass("in"); + a.attr("aria-expanded", c), b.toggleClass("collapsed", !c).attr("aria-expanded", c); + }); + var e = a.fn.collapse; + (a.fn.collapse = c), + (a.fn.collapse.Constructor = d), + (a.fn.collapse.noConflict = function () { + return (a.fn.collapse = e), this; + }), + a(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function (d) { + var e = a(this); + e.attr("data-target") || d.preventDefault(); + var f = b(e), + g = f.data("bs.collapse"), + h = g ? "toggle" : e.data(); + c.call(f, h); + }); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + var c = b.attr("data-target"); + c || ((c = b.attr("href")), (c = c && /#[A-Za-z]/.test(c) && c.replace(/.*(?=#[^\s]*$)/, ""))); + var d = c && a(c); + return d && d.length ? d : b.parent(); + } + function c(c) { + (c && 3 === c.which) || + (a(e).remove(), + a(f).each(function () { + var d = a(this), + e = b(d), + f = { relatedTarget: this }; + e.hasClass("open") && + ((c && "click" == c.type && /input|textarea/i.test(c.target.tagName) && a.contains(e[0], c.target)) || + (e.trigger((c = a.Event("hide.bs.dropdown", f))), + c.isDefaultPrevented() || + (d.attr("aria-expanded", "false"), e.removeClass("open").trigger(a.Event("hidden.bs.dropdown", f))))); + })); + } + function d(b) { + return this.each(function () { + var c = a(this), + d = c.data("bs.dropdown"); + d || c.data("bs.dropdown", (d = new g(this))), "string" == typeof b && d[b].call(c); + }); + } + var e = ".dropdown-backdrop", + f = '[data-toggle="dropdown"]', + g = function (b) { + a(b).on("click.bs.dropdown", this.toggle); + }; + (g.VERSION = "3.3.7"), + (g.prototype.toggle = function (d) { + var e = a(this); + if (!e.is(".disabled, :disabled")) { + var f = b(e), + g = f.hasClass("open"); + if ((c(), !g)) { + "ontouchstart" in document.documentElement && + !f.closest(".navbar-nav").length && + a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click", c); + var h = { relatedTarget: this }; + if ((f.trigger((d = a.Event("show.bs.dropdown", h))), d.isDefaultPrevented())) return; + e.trigger("focus").attr("aria-expanded", "true"), + f.toggleClass("open").trigger(a.Event("shown.bs.dropdown", h)); + } + return !1; + } + }), + (g.prototype.keydown = function (c) { + if (/(38|40|27|32)/.test(c.which) && !/input|textarea/i.test(c.target.tagName)) { + var d = a(this); + if ((c.preventDefault(), c.stopPropagation(), !d.is(".disabled, :disabled"))) { + var e = b(d), + g = e.hasClass("open"); + if ((!g && 27 != c.which) || (g && 27 == c.which)) + return 27 == c.which && e.find(f).trigger("focus"), d.trigger("click"); + var h = " li:not(.disabled):visible a", + i = e.find(".dropdown-menu" + h); + if (i.length) { + var j = i.index(c.target); + 38 == c.which && j > 0 && j--, + 40 == c.which && j < i.length - 1 && j++, + ~j || (j = 0), + i.eq(j).trigger("focus"); + } + } + } + }); + var h = a.fn.dropdown; + (a.fn.dropdown = d), + (a.fn.dropdown.Constructor = g), + (a.fn.dropdown.noConflict = function () { + return (a.fn.dropdown = h), this; + }), + a(document) + .on("click.bs.dropdown.data-api", c) + .on("click.bs.dropdown.data-api", ".dropdown form", function (a) { + a.stopPropagation(); + }) + .on("click.bs.dropdown.data-api", f, g.prototype.toggle) + .on("keydown.bs.dropdown.data-api", f, g.prototype.keydown) + .on("keydown.bs.dropdown.data-api", ".dropdown-menu", g.prototype.keydown); + })(jQuery), + +(function (a) { + "use strict"; + function b(b, d) { + return this.each(function () { + var e = a(this), + f = e.data("bs.modal"), + g = a.extend({}, c.DEFAULTS, e.data(), "object" == typeof b && b); + f || e.data("bs.modal", (f = new c(this, g))), "string" == typeof b ? f[b](d) : g.show && f.show(d); + }); + } + var c = function (b, c) { + (this.options = c), + (this.$body = a(document.body)), + (this.$element = a(b)), + (this.$dialog = this.$element.find(".modal-dialog")), + (this.$backdrop = null), + (this.isShown = null), + (this.originalBodyPad = null), + (this.scrollbarWidth = 0), + (this.ignoreBackdropClick = !1), + this.options.remote && + this.$element.find(".modal-content").load( + this.options.remote, + a.proxy(function () { + this.$element.trigger("loaded.bs.modal"); + }, this) + ); + }; + (c.VERSION = "3.3.7"), + (c.TRANSITION_DURATION = 300), + (c.BACKDROP_TRANSITION_DURATION = 150), + (c.DEFAULTS = { backdrop: !0, keyboard: !0, show: !0 }), + (c.prototype.toggle = function (a) { + return this.isShown ? this.hide() : this.show(a); + }), + (c.prototype.show = function (b) { + var d = this, + e = a.Event("show.bs.modal", { relatedTarget: b }); + this.$element.trigger(e), + this.isShown || + e.isDefaultPrevented() || + ((this.isShown = !0), + this.checkScrollbar(), + this.setScrollbar(), + this.$body.addClass("modal-open"), + this.escape(), + this.resize(), + this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', a.proxy(this.hide, this)), + this.$dialog.on("mousedown.dismiss.bs.modal", function () { + d.$element.one("mouseup.dismiss.bs.modal", function (b) { + a(b.target).is(d.$element) && (d.ignoreBackdropClick = !0); + }); + }), + this.backdrop(function () { + var e = a.support.transition && d.$element.hasClass("fade"); + d.$element.parent().length || d.$element.appendTo(d.$body), + d.$element.show().scrollTop(0), + d.adjustDialog(), + e && d.$element[0].offsetWidth, + d.$element.addClass("in"), + d.enforceFocus(); + var f = a.Event("shown.bs.modal", { relatedTarget: b }); + e + ? d.$dialog + .one("bsTransitionEnd", function () { + d.$element.trigger("focus").trigger(f); + }) + .emulateTransitionEnd(c.TRANSITION_DURATION) + : d.$element.trigger("focus").trigger(f); + })); + }), + (c.prototype.hide = function (b) { + b && b.preventDefault(), + (b = a.Event("hide.bs.modal")), + this.$element.trigger(b), + this.isShown && + !b.isDefaultPrevented() && + ((this.isShown = !1), + this.escape(), + this.resize(), + a(document).off("focusin.bs.modal"), + this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"), + this.$dialog.off("mousedown.dismiss.bs.modal"), + a.support.transition && this.$element.hasClass("fade") + ? this.$element + .one("bsTransitionEnd", a.proxy(this.hideModal, this)) + .emulateTransitionEnd(c.TRANSITION_DURATION) + : this.hideModal()); + }), + (c.prototype.enforceFocus = function () { + a(document) + .off("focusin.bs.modal") + .on( + "focusin.bs.modal", + a.proxy(function (a) { + document === a.target || + this.$element[0] === a.target || + this.$element.has(a.target).length || + this.$element.trigger("focus"); + }, this) + ); + }), + (c.prototype.escape = function () { + this.isShown && this.options.keyboard + ? this.$element.on( + "keydown.dismiss.bs.modal", + a.proxy(function (a) { + 27 == a.which && this.hide(); + }, this) + ) + : this.isShown || this.$element.off("keydown.dismiss.bs.modal"); + }), + (c.prototype.resize = function () { + this.isShown + ? a(window).on("resize.bs.modal", a.proxy(this.handleUpdate, this)) + : a(window).off("resize.bs.modal"); + }), + (c.prototype.hideModal = function () { + var a = this; + this.$element.hide(), + this.backdrop(function () { + a.$body.removeClass("modal-open"), + a.resetAdjustments(), + a.resetScrollbar(), + a.$element.trigger("hidden.bs.modal"); + }); + }), + (c.prototype.removeBackdrop = function () { + this.$backdrop && this.$backdrop.remove(), (this.$backdrop = null); + }), + (c.prototype.backdrop = function (b) { + var d = this, + e = this.$element.hasClass("fade") ? "fade" : ""; + if (this.isShown && this.options.backdrop) { + var f = a.support.transition && e; + if ( + ((this.$backdrop = a(document.createElement("div")) + .addClass("modal-backdrop " + e) + .appendTo(this.$body)), + this.$element.on( + "click.dismiss.bs.modal", + a.proxy(function (a) { + return this.ignoreBackdropClick + ? void (this.ignoreBackdropClick = !1) + : void ( + a.target === a.currentTarget && + ("static" == this.options.backdrop ? this.$element[0].focus() : this.hide()) + ); + }, this) + ), + f && this.$backdrop[0].offsetWidth, + this.$backdrop.addClass("in"), + !b) + ) + return; + f ? this.$backdrop.one("bsTransitionEnd", b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) : b(); + } else if (!this.isShown && this.$backdrop) { + this.$backdrop.removeClass("in"); + var g = function () { + d.removeBackdrop(), b && b(); + }; + a.support.transition && this.$element.hasClass("fade") + ? this.$backdrop.one("bsTransitionEnd", g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) + : g(); + } else b && b(); + }), + (c.prototype.handleUpdate = function () { + this.adjustDialog(); + }), + (c.prototype.adjustDialog = function () { + var a = this.$element[0].scrollHeight > document.documentElement.clientHeight; + this.$element.css({ + paddingLeft: !this.bodyIsOverflowing && a ? this.scrollbarWidth : "", + paddingRight: this.bodyIsOverflowing && !a ? this.scrollbarWidth : "", + }); + }), + (c.prototype.resetAdjustments = function () { + this.$element.css({ paddingLeft: "", paddingRight: "" }); + }), + (c.prototype.checkScrollbar = function () { + var a = window.innerWidth; + if (!a) { + var b = document.documentElement.getBoundingClientRect(); + a = b.right - Math.abs(b.left); + } + (this.bodyIsOverflowing = document.body.clientWidth < a), (this.scrollbarWidth = this.measureScrollbar()); + }), + (c.prototype.setScrollbar = function () { + var a = parseInt(this.$body.css("padding-right") || 0, 10); + (this.originalBodyPad = document.body.style.paddingRight || ""), + this.bodyIsOverflowing && this.$body.css("padding-right", a + this.scrollbarWidth); + }), + (c.prototype.resetScrollbar = function () { + this.$body.css("padding-right", this.originalBodyPad); + }), + (c.prototype.measureScrollbar = function () { + var a = document.createElement("div"); + (a.className = "modal-scrollbar-measure"), this.$body.append(a); + var b = a.offsetWidth - a.clientWidth; + return this.$body[0].removeChild(a), b; + }); + var d = a.fn.modal; + (a.fn.modal = b), + (a.fn.modal.Constructor = c), + (a.fn.modal.noConflict = function () { + return (a.fn.modal = d), this; + }), + a(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function (c) { + var d = a(this), + e = d.attr("href"), + f = a(d.attr("data-target") || (e && e.replace(/.*(?=#[^\s]+$)/, ""))), + g = f.data("bs.modal") ? "toggle" : a.extend({ remote: !/#/.test(e) && e }, f.data(), d.data()); + d.is("a") && c.preventDefault(), + f.one("show.bs.modal", function (a) { + a.isDefaultPrevented() || + f.one("hidden.bs.modal", function () { + d.is(":visible") && d.trigger("focus"); + }); + }), + b.call(f, g, this); + }); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data("bs.tooltip"), + f = "object" == typeof b && b; + (!e && /destroy|hide/.test(b)) || + (e || d.data("bs.tooltip", (e = new c(this, f))), "string" == typeof b && e[b]()); + }); + } + var c = function (a, b) { + (this.type = null), + (this.options = null), + (this.enabled = null), + (this.timeout = null), + (this.hoverState = null), + (this.$element = null), + (this.inState = null), + this.init("tooltip", a, b); + }; + (c.VERSION = "3.3.7"), + (c.TRANSITION_DURATION = 150), + (c.DEFAULTS = { + animation: !0, + placement: "top", + selector: !1, + template: + '', + trigger: "hover focus", + title: "", + delay: 0, + html: !1, + container: !1, + viewport: { selector: "body", padding: 0 }, + }), + (c.prototype.init = function (b, c, d) { + if ( + ((this.enabled = !0), + (this.type = b), + (this.$element = a(c)), + (this.options = this.getOptions(d)), + (this.$viewport = + this.options.viewport && + a( + a.isFunction(this.options.viewport) + ? this.options.viewport.call(this, this.$element) + : this.options.viewport.selector || this.options.viewport + )), + (this.inState = { click: !1, hover: !1, focus: !1 }), + this.$element[0] instanceof document.constructor && !this.options.selector) + ) + throw new Error( + "`selector` option must be specified when initializing " + this.type + " on the window.document object!" + ); + for (var e = this.options.trigger.split(" "), f = e.length; f--; ) { + var g = e[f]; + if ("click" == g) this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)); + else if ("manual" != g) { + var h = "hover" == g ? "mouseenter" : "focusin", + i = "hover" == g ? "mouseleave" : "focusout"; + this.$element.on(h + "." + this.type, this.options.selector, a.proxy(this.enter, this)), + this.$element.on(i + "." + this.type, this.options.selector, a.proxy(this.leave, this)); + } + } + this.options.selector + ? (this._options = a.extend({}, this.options, { + trigger: "manual", + selector: "", + })) + : this.fixTitle(); + }), + (c.prototype.getDefaults = function () { + return c.DEFAULTS; + }), + (c.prototype.getOptions = function (b) { + return ( + (b = a.extend({}, this.getDefaults(), this.$element.data(), b)), + b.delay && "number" == typeof b.delay && (b.delay = { show: b.delay, hide: b.delay }), + b + ); + }), + (c.prototype.getDelegateOptions = function () { + var b = {}, + c = this.getDefaults(); + return ( + this._options && + a.each(this._options, function (a, d) { + c[a] != d && (b[a] = d); + }), + b + ); + }), + (c.prototype.enter = function (b) { + var c = b instanceof this.constructor ? b : a(b.currentTarget).data("bs." + this.type); + return ( + c || + ((c = new this.constructor(b.currentTarget, this.getDelegateOptions())), + a(b.currentTarget).data("bs." + this.type, c)), + b instanceof a.Event && (c.inState["focusin" == b.type ? "focus" : "hover"] = !0), + c.tip().hasClass("in") || "in" == c.hoverState + ? void (c.hoverState = "in") + : (clearTimeout(c.timeout), + (c.hoverState = "in"), + c.options.delay && c.options.delay.show + ? void (c.timeout = setTimeout(function () { + "in" == c.hoverState && c.show(); + }, c.options.delay.show)) + : c.show()) + ); + }), + (c.prototype.isInStateTrue = function () { + for (var a in this.inState) if (this.inState[a]) return !0; + return !1; + }), + (c.prototype.leave = function (b) { + var c = b instanceof this.constructor ? b : a(b.currentTarget).data("bs." + this.type); + if ( + (c || + ((c = new this.constructor(b.currentTarget, this.getDelegateOptions())), + a(b.currentTarget).data("bs." + this.type, c)), + b instanceof a.Event && (c.inState["focusout" == b.type ? "focus" : "hover"] = !1), + !c.isInStateTrue()) + ) + return ( + clearTimeout(c.timeout), + (c.hoverState = "out"), + c.options.delay && c.options.delay.hide + ? void (c.timeout = setTimeout(function () { + "out" == c.hoverState && c.hide(); + }, c.options.delay.hide)) + : c.hide() + ); + }), + (c.prototype.show = function () { + var b = a.Event("show.bs." + this.type); + if (this.hasContent() && this.enabled) { + this.$element.trigger(b); + var d = a.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); + if (b.isDefaultPrevented() || !d) return; + var e = this, + f = this.tip(), + g = this.getUID(this.type); + this.setContent(), + f.attr("id", g), + this.$element.attr("aria-describedby", g), + this.options.animation && f.addClass("fade"); + var h = + "function" == typeof this.options.placement + ? this.options.placement.call(this, f[0], this.$element[0]) + : this.options.placement, + i = /\s?auto?\s?/i, + j = i.test(h); + j && (h = h.replace(i, "") || "top"), + f + .detach() + .css({ top: 0, left: 0, display: "block" }) + .addClass(h) + .data("bs." + this.type, this), + this.options.container ? f.appendTo(this.options.container) : f.insertAfter(this.$element), + this.$element.trigger("inserted.bs." + this.type); + var k = this.getPosition(), + l = f[0].offsetWidth, + m = f[0].offsetHeight; + if (j) { + var n = h, + o = this.getPosition(this.$viewport); + (h = + "bottom" == h && k.bottom + m > o.bottom + ? "top" + : "top" == h && k.top - m < o.top + ? "bottom" + : "right" == h && k.right + l > o.width + ? "left" + : "left" == h && k.left - l < o.left + ? "right" + : h), + f.removeClass(n).addClass(h); + } + var p = this.getCalculatedOffset(h, k, l, m); + this.applyPlacement(p, h); + var q = function () { + var a = e.hoverState; + e.$element.trigger("shown.bs." + e.type), (e.hoverState = null), "out" == a && e.leave(e); + }; + a.support.transition && this.$tip.hasClass("fade") + ? f.one("bsTransitionEnd", q).emulateTransitionEnd(c.TRANSITION_DURATION) + : q(); + } + }), + (c.prototype.applyPlacement = function (b, c) { + var d = this.tip(), + e = d[0].offsetWidth, + f = d[0].offsetHeight, + g = parseInt(d.css("margin-top"), 10), + h = parseInt(d.css("margin-left"), 10); + isNaN(g) && (g = 0), + isNaN(h) && (h = 0), + (b.top += g), + (b.left += h), + a.offset.setOffset( + d[0], + a.extend( + { + using: function (a) { + d.css({ top: Math.round(a.top), left: Math.round(a.left) }); + }, + }, + b + ), + 0 + ), + d.addClass("in"); + var i = d[0].offsetWidth, + j = d[0].offsetHeight; + "top" == c && j != f && (b.top = b.top + f - j); + var k = this.getViewportAdjustedDelta(c, b, i, j); + k.left ? (b.left += k.left) : (b.top += k.top); + var l = /top|bottom/.test(c), + m = l ? 2 * k.left - e + i : 2 * k.top - f + j, + n = l ? "offsetWidth" : "offsetHeight"; + d.offset(b), this.replaceArrow(m, d[0][n], l); + }), + (c.prototype.replaceArrow = function (a, b, c) { + this.arrow() + .css(c ? "left" : "top", 50 * (1 - a / b) + "%") + .css(c ? "top" : "left", ""); + }), + (c.prototype.setContent = function () { + var a = this.tip(), + b = this.getTitle(); + a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), + a.removeClass("fade in top bottom left right"); + }), + (c.prototype.hide = function (b) { + function d() { + "in" != e.hoverState && f.detach(), + e.$element && e.$element.removeAttr("aria-describedby").trigger("hidden.bs." + e.type), + b && b(); + } + var e = this, + f = a(this.$tip), + g = a.Event("hide.bs." + this.type); + if ((this.$element.trigger(g), !g.isDefaultPrevented())) + return ( + f.removeClass("in"), + a.support.transition && f.hasClass("fade") + ? f.one("bsTransitionEnd", d).emulateTransitionEnd(c.TRANSITION_DURATION) + : d(), + (this.hoverState = null), + this + ); + }), + (c.prototype.fixTitle = function () { + var a = this.$element; + (a.attr("title") || "string" != typeof a.attr("data-original-title")) && + a.attr("data-original-title", a.attr("title") || "").attr("title", ""); + }), + (c.prototype.hasContent = function () { + return this.getTitle(); + }), + (c.prototype.getPosition = function (b) { + b = b || this.$element; + var c = b[0], + d = "BODY" == c.tagName, + e = c.getBoundingClientRect(); + null == e.width && + (e = a.extend({}, e, { + width: e.right - e.left, + height: e.bottom - e.top, + })); + var f = window.SVGElement && c instanceof window.SVGElement, + g = d ? { top: 0, left: 0 } : f ? null : b.offset(), + h = { + scroll: d ? document.documentElement.scrollTop || document.body.scrollTop : b.scrollTop(), + }, + i = d ? { width: a(window).width(), height: a(window).height() } : null; + return a.extend({}, e, h, i, g); + }), + (c.prototype.getCalculatedOffset = function (a, b, c, d) { + return "bottom" == a + ? { top: b.top + b.height, left: b.left + b.width / 2 - c / 2 } + : "top" == a + ? { top: b.top - d, left: b.left + b.width / 2 - c / 2 } + : "left" == a + ? { top: b.top + b.height / 2 - d / 2, left: b.left - c } + : { top: b.top + b.height / 2 - d / 2, left: b.left + b.width }; + }), + (c.prototype.getViewportAdjustedDelta = function (a, b, c, d) { + var e = { top: 0, left: 0 }; + if (!this.$viewport) return e; + var f = (this.options.viewport && this.options.viewport.padding) || 0, + g = this.getPosition(this.$viewport); + if (/right|left/.test(a)) { + var h = b.top - f - g.scroll, + i = b.top + f - g.scroll + d; + h < g.top ? (e.top = g.top - h) : i > g.top + g.height && (e.top = g.top + g.height - i); + } else { + var j = b.left - f, + k = b.left + f + c; + j < g.left ? (e.left = g.left - j) : k > g.right && (e.left = g.left + g.width - k); + } + return e; + }), + (c.prototype.getTitle = function () { + var a, + b = this.$element, + c = this.options; + return (a = b.attr("data-original-title") || ("function" == typeof c.title ? c.title.call(b[0]) : c.title)); + }), + (c.prototype.getUID = function (a) { + do a += ~~(1e6 * Math.random()); + while (document.getElementById(a)); + return a; + }), + (c.prototype.tip = function () { + if (!this.$tip && ((this.$tip = a(this.options.template)), 1 != this.$tip.length)) + throw new Error(this.type + " `template` option must consist of exactly 1 top-level element!"); + return this.$tip; + }), + (c.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")); + }), + (c.prototype.enable = function () { + this.enabled = !0; + }), + (c.prototype.disable = function () { + this.enabled = !1; + }), + (c.prototype.toggleEnabled = function () { + this.enabled = !this.enabled; + }), + (c.prototype.toggle = function (b) { + var c = this; + b && + ((c = a(b.currentTarget).data("bs." + this.type)), + c || + ((c = new this.constructor(b.currentTarget, this.getDelegateOptions())), + a(b.currentTarget).data("bs." + this.type, c))), + b + ? ((c.inState.click = !c.inState.click), c.isInStateTrue() ? c.enter(c) : c.leave(c)) + : c.tip().hasClass("in") + ? c.leave(c) + : c.enter(c); + }), + (c.prototype.destroy = function () { + var a = this; + clearTimeout(this.timeout), + this.hide(function () { + a.$element.off("." + a.type).removeData("bs." + a.type), + a.$tip && a.$tip.detach(), + (a.$tip = null), + (a.$arrow = null), + (a.$viewport = null), + (a.$element = null); + }); + }); + var d = a.fn.tooltip; + (a.fn.tooltip = b), + (a.fn.tooltip.Constructor = c), + (a.fn.tooltip.noConflict = function () { + return (a.fn.tooltip = d), this; + }); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data("bs.popover"), + f = "object" == typeof b && b; + (!e && /destroy|hide/.test(b)) || + (e || d.data("bs.popover", (e = new c(this, f))), "string" == typeof b && e[b]()); + }); + } + var c = function (a, b) { + this.init("popover", a, b); + }; + if (!a.fn.tooltip) throw new Error("Popover requires tooltip.js"); + (c.VERSION = "3.3.7"), + (c.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, { + placement: "right", + trigger: "click", + content: "", + template: + '', + })), + (c.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype)), + (c.prototype.constructor = c), + (c.prototype.getDefaults = function () { + return c.DEFAULTS; + }), + (c.prototype.setContent = function () { + var a = this.tip(), + b = this.getTitle(), + c = this.getContent(); + a.find(".popover-title")[this.options.html ? "html" : "text"](b), + a + .find(".popover-content") + .children() + .detach() + .end() + [this.options.html ? ("string" == typeof c ? "html" : "append") : "text"](c), + a.removeClass("fade top bottom left right in"), + a.find(".popover-title").html() || a.find(".popover-title").hide(); + }), + (c.prototype.hasContent = function () { + return this.getTitle() || this.getContent(); + }), + (c.prototype.getContent = function () { + var a = this.$element, + b = this.options; + return a.attr("data-content") || ("function" == typeof b.content ? b.content.call(a[0]) : b.content); + }), + (c.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find(".arrow")); + }); + var d = a.fn.popover; + (a.fn.popover = b), + (a.fn.popover.Constructor = c), + (a.fn.popover.noConflict = function () { + return (a.fn.popover = d), this; + }); + })(jQuery), + +(function (a) { + "use strict"; + function b(c, d) { + (this.$body = a(document.body)), + (this.$scrollElement = a(a(c).is(document.body) ? window : c)), + (this.options = a.extend({}, b.DEFAULTS, d)), + (this.selector = (this.options.target || "") + " .nav li > a"), + (this.offsets = []), + (this.targets = []), + (this.activeTarget = null), + (this.scrollHeight = 0), + this.$scrollElement.on("scroll.bs.scrollspy", a.proxy(this.process, this)), + this.refresh(), + this.process(); + } + function c(c) { + return this.each(function () { + var d = a(this), + e = d.data("bs.scrollspy"), + f = "object" == typeof c && c; + e || d.data("bs.scrollspy", (e = new b(this, f))), "string" == typeof c && e[c](); + }); + } + (b.VERSION = "3.3.7"), + (b.DEFAULTS = { offset: 10 }), + (b.prototype.getScrollHeight = function () { + return ( + this.$scrollElement[0].scrollHeight || + Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) + ); + }), + (b.prototype.refresh = function () { + var b = this, + c = "offset", + d = 0; + (this.offsets = []), + (this.targets = []), + (this.scrollHeight = this.getScrollHeight()), + a.isWindow(this.$scrollElement[0]) || ((c = "position"), (d = this.$scrollElement.scrollTop())), + this.$body + .find(this.selector) + .map(function () { + var b = a(this), + e = b.data("target") || b.attr("href"), + f = /^#./.test(e) && a(e); + return (f && f.length && f.is(":visible") && [[f[c]().top + d, e]]) || null; + }) + .sort(function (a, b) { + return a[0] - b[0]; + }) + .each(function () { + b.offsets.push(this[0]), b.targets.push(this[1]); + }); + }), + (b.prototype.process = function () { + var a, + b = this.$scrollElement.scrollTop() + this.options.offset, + c = this.getScrollHeight(), + d = this.options.offset + c - this.$scrollElement.height(), + e = this.offsets, + f = this.targets, + g = this.activeTarget; + if ((this.scrollHeight != c && this.refresh(), b >= d)) return g != (a = f[f.length - 1]) && this.activate(a); + if (g && b < e[0]) return (this.activeTarget = null), this.clear(); + for (a = e.length; a--; ) + g != f[a] && b >= e[a] && (void 0 === e[a + 1] || b < e[a + 1]) && this.activate(f[a]); + }), + (b.prototype.activate = function (b) { + (this.activeTarget = b), this.clear(); + var c = this.selector + '[data-target="' + b + '"],' + this.selector + '[href="' + b + '"]', + d = a(c).parents("li").addClass("active"); + d.parent(".dropdown-menu").length && (d = d.closest("li.dropdown").addClass("active")), + d.trigger("activate.bs.scrollspy"); + }), + (b.prototype.clear = function () { + a(this.selector).parentsUntil(this.options.target, ".active").removeClass("active"); + }); + var d = a.fn.scrollspy; + (a.fn.scrollspy = c), + (a.fn.scrollspy.Constructor = b), + (a.fn.scrollspy.noConflict = function () { + return (a.fn.scrollspy = d), this; + }), + a(window).on("load.bs.scrollspy.data-api", function () { + a('[data-spy="scroll"]').each(function () { + var b = a(this); + c.call(b, b.data()); + }); + }); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data("bs.tab"); + e || d.data("bs.tab", (e = new c(this))), "string" == typeof b && e[b](); + }); + } + var c = function (b) { + this.element = a(b); + }; + (c.VERSION = "3.3.7"), + (c.TRANSITION_DURATION = 150), + (c.prototype.show = function () { + var b = this.element, + c = b.closest("ul:not(.dropdown-menu)"), + d = b.data("target"); + if ( + (d || ((d = b.attr("href")), (d = d && d.replace(/.*(?=#[^\s]*$)/, ""))), !b.parent("li").hasClass("active")) + ) { + var e = c.find(".active:last a"), + f = a.Event("hide.bs.tab", { relatedTarget: b[0] }), + g = a.Event("show.bs.tab", { relatedTarget: e[0] }); + if ((e.trigger(f), b.trigger(g), !g.isDefaultPrevented() && !f.isDefaultPrevented())) { + var h = a(d); + this.activate(b.closest("li"), c), + this.activate(h, h.parent(), function () { + e.trigger({ type: "hidden.bs.tab", relatedTarget: b[0] }), + b.trigger({ type: "shown.bs.tab", relatedTarget: e[0] }); + }); + } + } + }), + (c.prototype.activate = function (b, d, e) { + function f() { + g + .removeClass("active") + .find("> .dropdown-menu > .active") + .removeClass("active") + .end() + .find('[data-toggle="tab"]') + .attr("aria-expanded", !1), + b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0), + h ? (b[0].offsetWidth, b.addClass("in")) : b.removeClass("fade"), + b.parent(".dropdown-menu").length && + b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0), + e && e(); + } + var g = d.find("> .active"), + h = e && a.support.transition && ((g.length && g.hasClass("fade")) || !!d.find("> .fade").length); + g.length && h ? g.one("bsTransitionEnd", f).emulateTransitionEnd(c.TRANSITION_DURATION) : f(), + g.removeClass("in"); + }); + var d = a.fn.tab; + (a.fn.tab = b), + (a.fn.tab.Constructor = c), + (a.fn.tab.noConflict = function () { + return (a.fn.tab = d), this; + }); + var e = function (c) { + c.preventDefault(), b.call(a(this), "show"); + }; + a(document) + .on("click.bs.tab.data-api", '[data-toggle="tab"]', e) + .on("click.bs.tab.data-api", '[data-toggle="pill"]', e); + })(jQuery), + +(function (a) { + "use strict"; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data("bs.affix"), + f = "object" == typeof b && b; + e || d.data("bs.affix", (e = new c(this, f))), "string" == typeof b && e[b](); + }); + } + var c = function (b, d) { + (this.options = a.extend({}, c.DEFAULTS, d)), + (this.$target = a(this.options.target) + .on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this)) + .on("click.bs.affix.data-api", a.proxy(this.checkPositionWithEventLoop, this))), + (this.$element = a(b)), + (this.affixed = null), + (this.unpin = null), + (this.pinnedOffset = null), + this.checkPosition(); + }; + (c.VERSION = "3.3.7"), + (c.RESET = "affix affix-top affix-bottom"), + (c.DEFAULTS = { offset: 0, target: window }), + (c.prototype.getState = function (a, b, c, d) { + var e = this.$target.scrollTop(), + f = this.$element.offset(), + g = this.$target.height(); + if (null != c && "top" == this.affixed) return e < c && "top"; + if ("bottom" == this.affixed) + return null != c ? !(e + this.unpin <= f.top) && "bottom" : !(e + g <= a - d) && "bottom"; + var h = null == this.affixed, + i = h ? e : f.top, + j = h ? g : b; + return null != c && e <= c ? "top" : null != d && i + j >= a - d && "bottom"; + }), + (c.prototype.getPinnedOffset = function () { + if (this.pinnedOffset) return this.pinnedOffset; + this.$element.removeClass(c.RESET).addClass("affix"); + var a = this.$target.scrollTop(), + b = this.$element.offset(); + return (this.pinnedOffset = b.top - a); + }), + (c.prototype.checkPositionWithEventLoop = function () { + setTimeout(a.proxy(this.checkPosition, this), 1); + }), + (c.prototype.checkPosition = function () { + if (this.$element.is(":visible")) { + var b = this.$element.height(), + d = this.options.offset, + e = d.top, + f = d.bottom, + g = Math.max(a(document).height(), a(document.body).height()); + "object" != typeof d && (f = e = d), + "function" == typeof e && (e = d.top(this.$element)), + "function" == typeof f && (f = d.bottom(this.$element)); + var h = this.getState(g, b, e, f); + if (this.affixed != h) { + null != this.unpin && this.$element.css("top", ""); + var i = "affix" + (h ? "-" + h : ""), + j = a.Event(i + ".bs.affix"); + if ((this.$element.trigger(j), j.isDefaultPrevented())) return; + (this.affixed = h), + (this.unpin = "bottom" == h ? this.getPinnedOffset() : null), + this.$element + .removeClass(c.RESET) + .addClass(i) + .trigger(i.replace("affix", "affixed") + ".bs.affix"); + } + "bottom" == h && this.$element.offset({ top: g - b - f }); + } + }); + var d = a.fn.affix; + (a.fn.affix = b), + (a.fn.affix.Constructor = c), + (a.fn.affix.noConflict = function () { + return (a.fn.affix = d), this; + }), + a(window).on("load", function () { + a('[data-spy="affix"]').each(function () { + var c = a(this), + d = c.data(); + (d.offset = d.offset || {}), + null != d.offsetBottom && (d.offset.bottom = d.offsetBottom), + null != d.offsetTop && (d.offset.top = d.offsetTop), + b.call(c, d); + }); + }); + })(jQuery); diff --git a/__DOCS__/JSDocTemplate/.test/js/clipboard.min.js b/__DOCS__/JSDocTemplate/.test/js/clipboard.min.js index 7a4fde6..632d7a7 100644 --- a/__DOCS__/JSDocTemplate/.test/js/clipboard.min.js +++ b/__DOCS__/JSDocTemplate/.test/js/clipboard.min.js @@ -1,7 +1,553 @@ /*! * clipboard.js v2.0.1 * https://zenorocha.github.io/clipboard.js - * + * * Licensed MIT © Zeno Rocha */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(t){return t&&t.__esModule?t:{default:t}}(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodeType!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}t.exports=n}])}); \ No newline at end of file +!(function (t, e) { + "object" == typeof exports && "object" == typeof module + ? (module.exports = e()) + : "function" == typeof define && define.amd + ? define([], e) + : "object" == typeof exports + ? (exports.ClipboardJS = e()) + : (t.ClipboardJS = e()); +})(this, function () { + return (function (t) { + function e(o) { + if (n[o]) return n[o].exports; + var r = (n[o] = { i: o, l: !1, exports: {} }); + return t[o].call(r.exports, r, r.exports, e), (r.l = !0), r.exports; + } + var n = {}; + return ( + (e.m = t), + (e.c = n), + (e.i = function (t) { + return t; + }), + (e.d = function (t, n, o) { + e.o(t, n) || + Object.defineProperty(t, n, { + configurable: !1, + enumerable: !0, + get: o, + }); + }), + (e.n = function (t) { + var n = + t && t.__esModule + ? function () { + return t.default; + } + : function () { + return t; + }; + return e.d(n, "a", n), n; + }), + (e.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + (e.p = ""), + e((e.s = 3)) + ); + })([ + function (t, e, n) { + var o, r, i; + !(function (a, c) { + (r = [t, n(7)]), (o = c), void 0 !== (i = "function" == typeof o ? o.apply(e, r) : o) && (t.exports = i); + })(0, function (t, e) { + "use strict"; + function n(t, e) { + if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); + } + var o = (function (t) { + return t && t.__esModule ? t : { default: t }; + })(e), + r = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype + ? "symbol" + : typeof t; + }, + i = (function () { + function t(t, e) { + for (var n = 0; n < e.length; n++) { + var o = e[n]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(t, o.key, o); + } + } + return function (e, n, o) { + return n && t(e.prototype, n), o && t(e, o), e; + }; + })(), + a = (function () { + function t(e) { + n(this, t), this.resolveOptions(e), this.initSelection(); + } + return ( + i(t, [ + { + key: "resolveOptions", + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + (this.action = t.action), + (this.container = t.container), + (this.emitter = t.emitter), + (this.target = t.target), + (this.text = t.text), + (this.trigger = t.trigger), + (this.selectedText = ""); + }, + }, + { + key: "initSelection", + value: function () { + this.text ? this.selectFake() : this.target && this.selectTarget(); + }, + }, + { + key: "selectFake", + value: function () { + var t = this, + e = "rtl" == document.documentElement.getAttribute("dir"); + this.removeFake(), + (this.fakeHandlerCallback = function () { + return t.removeFake(); + }), + (this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || !0), + (this.fakeElem = document.createElement("textarea")), + (this.fakeElem.style.fontSize = "12pt"), + (this.fakeElem.style.border = "0"), + (this.fakeElem.style.padding = "0"), + (this.fakeElem.style.margin = "0"), + (this.fakeElem.style.position = "absolute"), + (this.fakeElem.style[e ? "right" : "left"] = "-9999px"); + var n = window.pageYOffset || document.documentElement.scrollTop; + (this.fakeElem.style.top = n + "px"), + this.fakeElem.setAttribute("readonly", ""), + (this.fakeElem.value = this.text), + this.container.appendChild(this.fakeElem), + (this.selectedText = (0, o.default)(this.fakeElem)), + this.copyText(); + }, + }, + { + key: "removeFake", + value: function () { + this.fakeHandler && + (this.container.removeEventListener("click", this.fakeHandlerCallback), + (this.fakeHandler = null), + (this.fakeHandlerCallback = null)), + this.fakeElem && (this.container.removeChild(this.fakeElem), (this.fakeElem = null)); + }, + }, + { + key: "selectTarget", + value: function () { + (this.selectedText = (0, o.default)(this.target)), this.copyText(); + }, + }, + { + key: "copyText", + value: function () { + var t = void 0; + try { + t = document.execCommand(this.action); + } catch (e) { + t = !1; + } + this.handleResult(t); + }, + }, + { + key: "handleResult", + value: function (t) { + this.emitter.emit(t ? "success" : "error", { + action: this.action, + text: this.selectedText, + trigger: this.trigger, + clearSelection: this.clearSelection.bind(this), + }); + }, + }, + { + key: "clearSelection", + value: function () { + this.trigger && this.trigger.focus(), window.getSelection().removeAllRanges(); + }, + }, + { + key: "destroy", + value: function () { + this.removeFake(); + }, + }, + { + key: "action", + set: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "copy"; + if (((this._action = t), "copy" !== this._action && "cut" !== this._action)) + throw new Error('Invalid "action" value, use either "copy" or "cut"'); + }, + get: function () { + return this._action; + }, + }, + { + key: "target", + set: function (t) { + if (void 0 !== t) { + if (!t || "object" !== (void 0 === t ? "undefined" : r(t)) || 1 !== t.nodeType) + throw new Error('Invalid "target" value, use a valid Element'); + if ("copy" === this.action && t.hasAttribute("disabled")) + throw new Error( + 'Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute' + ); + if ("cut" === this.action && (t.hasAttribute("readonly") || t.hasAttribute("disabled"))) + throw new Error( + 'Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes' + ); + this._target = t; + } + }, + get: function () { + return this._target; + }, + }, + ]), + t + ); + })(); + t.exports = a; + }); + }, + function (t, e, n) { + function o(t, e, n) { + if (!t && !e && !n) throw new Error("Missing required arguments"); + if (!c.string(e)) throw new TypeError("Second argument must be a String"); + if (!c.fn(n)) throw new TypeError("Third argument must be a Function"); + if (c.node(t)) return r(t, e, n); + if (c.nodeList(t)) return i(t, e, n); + if (c.string(t)) return a(t, e, n); + throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList"); + } + function r(t, e, n) { + return ( + t.addEventListener(e, n), + { + destroy: function () { + t.removeEventListener(e, n); + }, + } + ); + } + function i(t, e, n) { + return ( + Array.prototype.forEach.call(t, function (t) { + t.addEventListener(e, n); + }), + { + destroy: function () { + Array.prototype.forEach.call(t, function (t) { + t.removeEventListener(e, n); + }); + }, + } + ); + } + function a(t, e, n) { + return u(document.body, t, e, n); + } + var c = n(6), + u = n(5); + t.exports = o; + }, + function (t, e) { + function n() {} + (n.prototype = { + on: function (t, e, n) { + var o = this.e || (this.e = {}); + return (o[t] || (o[t] = [])).push({ fn: e, ctx: n }), this; + }, + once: function (t, e, n) { + function o() { + r.off(t, o), e.apply(n, arguments); + } + var r = this; + return (o._ = e), this.on(t, o, n); + }, + emit: function (t) { + var e = [].slice.call(arguments, 1), + n = ((this.e || (this.e = {}))[t] || []).slice(), + o = 0, + r = n.length; + for (o; o < r; o++) n[o].fn.apply(n[o].ctx, e); + return this; + }, + off: function (t, e) { + var n = this.e || (this.e = {}), + o = n[t], + r = []; + if (o && e) for (var i = 0, a = o.length; i < a; i++) o[i].fn !== e && o[i].fn._ !== e && r.push(o[i]); + return r.length ? (n[t] = r) : delete n[t], this; + }, + }), + (t.exports = n); + }, + function (t, e, n) { + var o, r, i; + !(function (a, c) { + (r = [t, n(0), n(2), n(1)]), + (o = c), + void 0 !== (i = "function" == typeof o ? o.apply(e, r) : o) && (t.exports = i); + })(0, function (t, e, n, o) { + "use strict"; + function r(t) { + return t && t.__esModule ? t : { default: t }; + } + function i(t, e) { + if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); + } + function a(t, e) { + if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return !e || ("object" != typeof e && "function" != typeof e) ? t : e; + } + function c(t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError("Super expression must either be null or a function, not " + typeof e); + (t.prototype = Object.create(e && e.prototype, { + constructor: { + value: t, + enumerable: !1, + writable: !0, + configurable: !0, + }, + })), + e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : (t.__proto__ = e)); + } + function u(t, e) { + var n = "data-clipboard-" + t; + if (e.hasAttribute(n)) return e.getAttribute(n); + } + var l = r(e), + s = r(n), + f = r(o), + d = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype + ? "symbol" + : typeof t; + }, + h = (function () { + function t(t, e) { + for (var n = 0; n < e.length; n++) { + var o = e[n]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(t, o.key, o); + } + } + return function (e, n, o) { + return n && t(e.prototype, n), o && t(e, o), e; + }; + })(), + p = (function (t) { + function e(t, n) { + i(this, e); + var o = a(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this)); + return o.resolveOptions(n), o.listenClick(t), o; + } + return ( + c(e, t), + h( + e, + [ + { + key: "resolveOptions", + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + (this.action = "function" == typeof t.action ? t.action : this.defaultAction), + (this.target = "function" == typeof t.target ? t.target : this.defaultTarget), + (this.text = "function" == typeof t.text ? t.text : this.defaultText), + (this.container = "object" === d(t.container) ? t.container : document.body); + }, + }, + { + key: "listenClick", + value: function (t) { + var e = this; + this.listener = (0, f.default)(t, "click", function (t) { + return e.onClick(t); + }); + }, + }, + { + key: "onClick", + value: function (t) { + var e = t.delegateTarget || t.currentTarget; + this.clipboardAction && (this.clipboardAction = null), + (this.clipboardAction = new l.default({ + action: this.action(e), + target: this.target(e), + text: this.text(e), + container: this.container, + trigger: e, + emitter: this, + })); + }, + }, + { + key: "defaultAction", + value: function (t) { + return u("action", t); + }, + }, + { + key: "defaultTarget", + value: function (t) { + var e = u("target", t); + if (e) return document.querySelector(e); + }, + }, + { + key: "defaultText", + value: function (t) { + return u("text", t); + }, + }, + { + key: "destroy", + value: function () { + this.listener.destroy(), + this.clipboardAction && (this.clipboardAction.destroy(), (this.clipboardAction = null)); + }, + }, + ], + [ + { + key: "isSupported", + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ["copy", "cut"], + e = "string" == typeof t ? [t] : t, + n = !!document.queryCommandSupported; + return ( + e.forEach(function (t) { + n = n && !!document.queryCommandSupported(t); + }), + n + ); + }, + }, + ] + ), + e + ); + })(s.default); + t.exports = p; + }); + }, + function (t, e) { + function n(t, e) { + for (; t && t.nodeType !== o; ) { + if ("function" == typeof t.matches && t.matches(e)) return t; + t = t.parentNode; + } + } + var o = 9; + if ("undefined" != typeof Element && !Element.prototype.matches) { + var r = Element.prototype; + r.matches = + r.matchesSelector || + r.mozMatchesSelector || + r.msMatchesSelector || + r.oMatchesSelector || + r.webkitMatchesSelector; + } + t.exports = n; + }, + function (t, e, n) { + function o(t, e, n, o, r) { + var a = i.apply(this, arguments); + return ( + t.addEventListener(n, a, r), + { + destroy: function () { + t.removeEventListener(n, a, r); + }, + } + ); + } + function r(t, e, n, r, i) { + return "function" == typeof t.addEventListener + ? o.apply(null, arguments) + : "function" == typeof n + ? o.bind(null, document).apply(null, arguments) + : ("string" == typeof t && (t = document.querySelectorAll(t)), + Array.prototype.map.call(t, function (t) { + return o(t, e, n, r, i); + })); + } + function i(t, e, n, o) { + return function (n) { + (n.delegateTarget = a(n.target, e)), n.delegateTarget && o.call(t, n); + }; + } + var a = n(4); + t.exports = r; + }, + function (t, e) { + (e.node = function (t) { + return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType; + }), + (e.nodeList = function (t) { + var n = Object.prototype.toString.call(t); + return ( + void 0 !== t && + ("[object NodeList]" === n || "[object HTMLCollection]" === n) && + "length" in t && + (0 === t.length || e.node(t[0])) + ); + }), + (e.string = function (t) { + return "string" == typeof t || t instanceof String; + }), + (e.fn = function (t) { + return "[object Function]" === Object.prototype.toString.call(t); + }); + }, + function (t, e) { + function n(t) { + var e; + if ("SELECT" === t.nodeName) t.focus(), (e = t.value); + else if ("INPUT" === t.nodeName || "TEXTAREA" === t.nodeName) { + var n = t.hasAttribute("readonly"); + n || t.setAttribute("readonly", ""), + t.select(), + t.setSelectionRange(0, t.value.length), + n || t.removeAttribute("readonly"), + (e = t.value); + } else { + t.hasAttribute("contenteditable") && t.focus(); + var o = window.getSelection(), + r = document.createRange(); + r.selectNodeContents(t), o.removeAllRanges(), o.addRange(r), (e = o.toString()); + } + return e; + } + t.exports = n; + }, + ]); +}); diff --git a/__DOCS__/JSDocTemplate/.test/js/jquery.min.js b/__DOCS__/JSDocTemplate/.test/js/jquery.min.js index 4d9b3a2..9e7395d 100644 --- a/__DOCS__/JSDocTemplate/.test/js/jquery.min.js +++ b/__DOCS__/JSDocTemplate/.test/js/jquery.min.js @@ -1,2 +1,4647 @@ /*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w(" - - - - - -
-
-
- -
-

Classes

- -
-
-
- -
-
-
-
- -
Documentation generated by JSDoc 3.5.5 on 1st May 2018 using the FooDoc template.
-
- - - - - - - - - - - \ No newline at end of file + + + + + + Classes + + + + + + + + + + + + +
+
+
+ +
+

Classes

+ +
+
+
+ +
+
+
+
+ +
+ Documentation generated by + JSDoc 3.5.5 on 1st May 2018 using the + FooDoc template. +
+
+ + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/list_namespace.html b/__DOCS__/JSDocTemplate/.test/list_namespace.html index ddeb297..c9d936d 100644 --- a/__DOCS__/JSDocTemplate/.test/list_namespace.html +++ b/__DOCS__/JSDocTemplate/.test/list_namespace.html @@ -1,151 +1,239 @@ - - - - - - Namespaces - - - - - - - - - - - -
-
-
- -
-

Namespaces

-
-
- -
-

MyApi

-

This is the test summary for the MyApi namespace.

-
-
-
-
-
-
-

MyApi.utils

-

This is to test child namespaces.

-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
Documentation generated by JSDoc 3.5.5 on 1st May 2018 using the FooDoc template.
-
- - - - - - - - - - - \ No newline at end of file + + + + + + Namespaces + + + + + + + + + + + + +
+
+
+ +
+

Namespaces

+
+
+
+

+ MyApi +

+
+

+ This is the test summary for the + MyApi namespace. +

+
+
+
+
+
+
+
+

+ MyApi.utils +

+
+

This is to test child namespaces.

+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+ Documentation generated by + JSDoc 3.5.5 on 1st May 2018 using the + FooDoc template. +
+
+ + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/list_tutorial.html b/__DOCS__/JSDocTemplate/.test/list_tutorial.html index 5d1101d..4af9db8 100644 --- a/__DOCS__/JSDocTemplate/.test/list_tutorial.html +++ b/__DOCS__/JSDocTemplate/.test/list_tutorial.html @@ -1,165 +1,251 @@ - - - - - - Tutorials - - - - - - - - - - - -
-
-
- -
-

Tutorials

-
-
- -
-

Brush Teeth

-

How to brush your teeth!

-
-
-
-
-
-

Fence Test

-

Testing syntax highlighting.

-
-
-
-
-
-
-
-
-
-
-
-

Drive Car

-

How to drive a car!

-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
Documentation generated by JSDoc 3.5.5 on 1st May 2018 using the FooDoc template.
-
- - - - - - - - - - - \ No newline at end of file + + + + + + Tutorials + + + + + + + + + + + + +
+
+
+ +
+

Tutorials

+
+
+
+

+ Brush Teeth +

+

How to brush your teeth!

+
+
+
+
+
+
+

+ Fence Test +

+
+

Testing syntax highlighting.

+
+
+
+
+
+
+
+
+
+
+
+
+

+ Drive Car +

+

How to drive a car!

+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+ Documentation generated by + JSDoc 3.5.5 on 1st May 2018 using the + FooDoc template. +
+
+ + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/tutorial-brush-teeth.html b/__DOCS__/JSDocTemplate/.test/tutorial-brush-teeth.html index ddb2c2a..356183f 100644 --- a/__DOCS__/JSDocTemplate/.test/tutorial-brush-teeth.html +++ b/__DOCS__/JSDocTemplate/.test/tutorial-brush-teeth.html @@ -1,176 +1,334 @@ - - - - - - - Brush Teeth - - - - - - - - - - - -
-
-
- -
-

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra, tellus et fermentum tincidunt, massa ligula dignissim augue, ut aliquam tortor odio in odio. In faucibus metus metus. Curabitur est mi, fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan ac porta tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, mauris vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis commodo.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
Fusce laciniamauris ac aliquamconsequatlacus urna feugiat eratid viverra mi mi sit amet tortor
Etiam ac134.56.78910
Pellentesque e2234
-

neque lacus, quis posuere orci. Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In erat urna, condimentum ac feugiat id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas dignissim nulla in turpis tempus sed rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, dolor metus rhoncus justo, sed semper ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar neque in porta. Nullam quis lacus orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a.

-

Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. Aliquam ac convallis enim.

-

Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat.

-

Nunc faucibus lacus eget odio ultricies nec ullamcorper risus pharetra. Nunc nec consequat urna. Curabitur condimentum ante vitae erat tristique vitae gravida quam dapibus. Cras ac justo dui, at faucibus urna. Nunc tristique, velit id feugiat fermentum, dolor enim egestas erat, at vestibulum ante ipsum vel orci. Duis quis ante id justo vehicula eleifend sed et urna. Sed sapien tortor, rutrum id ultrices eu, tincidunt tincidunt mi. Etiam blandit, neque eget interdum dignissim, lacus ante facilisis dolor, non viverra dui lorem vitae nibh. Morbi volutpat augue eget nulla luctus eu aliquam sem facilisis. Pellentesque sollicitudin commodo dolor sit amet vestibulum. Nam dictum posuere quam, in tincidunt erat rutrum eu.

-

Etiam nec turpis purus, at lacinia sem. In commodo lacinia euismod. Curabitur tincidunt congue leo, eget iaculis orci volutpat pharetra. Fusce dignissim lacus lacus. Integer consectetur lacus rutrum risus malesuada at consectetur erat rutrum. Sed magna ipsum, fringilla eget auctor non, fringilla nec massa. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum nec tortor id nisi luctus aliquam. Maecenas cursus tincidunt ornare. Nulla a vestibulum odio. Mauris malesuada commodo justo quis mattis. Suspendisse mauris ligula, placerat at egestas in, tincidunt quis nibh. Aliquam ullamcorper elit at augue cursus quis pellentesque purus viverra.

-

Nulla ultricies justo ac nisi consectetur posuere. Donec ornare pharetra erat, nec facilisis dui cursus quis. Quisque porttitor porttitor orci, sed facilisis urna facilisis sed. Sed tincidunt adipiscing turpis et hendrerit. Cras posuere orci ut mauris ullamcorper vitae laoreet nisi luctus. In rutrum tristique augue. Nam eleifend dignissim dui.

-

Donec viverra egestas tellus non viverra. Aenean est ante, egestas sed scelerisque quis, aliquet sed lacus. Praesent non mauris neque, et adipiscing ante. Vestibulum quis quam vitae ipsum aliquet blandit. Vivamus condimentum euismod orci, in tincidunt justo rutrum faucibus. Phasellus nec lorem arcu. Donec tortor dui, facilisis in rutrum sit amet, pulvinar vitae lacus. Nam sodales sem eu nunc scelerisque vitae ullamcorper dolor facilisis. Duis imperdiet nisi in magna tempor convallis. Fusce at metus augue. Quisque dictum tempus mauris, in mattis ligula dignissim ut.

-

Proin sodales, mi at tincidunt ornare, mi dui sagittis velit, sed dictum risus orci eu erat. Sed nunc leo, congue sed rutrum eget, lobortis ac lectus. Etiam non arcu nulla. Vestibulum rutrum dolor pulvinar lorem posuere blandit. Sed quis sapien dui. Nunc sagittis erat commodo quam porta cursus in non erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin a molestie neque. Aliquam iaculis lacus sed neque hendrerit at dignissim ligula imperdiet. Suspendisse venenatis, lorem at luctus scelerisque, sem purus pellentesque sapien, vitae ornare ipsum quam nec dui. Mauris neque est, interdum nec pulvinar eget, dapibus eleifend tellus. Fusce non lorem tortor. Nullam eget nunc quis felis aliquam consectetur. Aliquam tristique, turpis in feugiat blandit, lectus erat condimentum tortor, non egestas nisl sapien eget nibh.

-

Aliquam elit turpis, faucibus et porta et, egestas nec nibh. Sed nisl est, pharetra a eleifend a, pretium ac eros. Sed leo eros, pulvinar vel faucibus dictum, aliquet ut quam. Maecenas et felis non ligula fringilla pretium fringilla sit amet ante. Nam varius imperdiet interdum. Ut non metus mauris, vel volutpat lorem. Nullam sagittis est quis lacus feugiat fringilla. Quisque orci lorem, semper ac accumsan vitae, blandit quis velit. Proin luctus sodales ultrices. Fusce mauris erat, facilisis ut consectetur at, fringilla feugiat orci. Aliquam a nisi a neque interdum suscipit id eget purus. Pellentesque tincidunt justo ut urna posuere non molestie quam auctor.

- -
-
-
- -
-
-
-
- -
Documentation generated by JSDoc 3.5.5 on 1st May 2018 using the FooDoc template.
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + + Brush Teeth + + + + + + + + + + + + +
+
+
+ +
+
+

Lorem ipsum dolor sit amet

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra, tellus et fermentum tincidunt, + massa ligula dignissim augue, ut aliquam tortor odio in odio. In faucibus metus metus. Curabitur est mi, + fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan ac porta + tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, mauris + vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies + porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin + velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis + commodo. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Fusce laciniamauris ac aliquamconsequatlacus urna feugiat eratid viverra mi mi sit amet tortor
Etiam ac134.56.78910
Pellentesque e2234
+

+ neque lacus, quis posuere orci. Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In + erat urna, condimentum ac feugiat id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas + dignissim nulla in turpis tempus sed rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, + dolor metus rhoncus justo, sed semper ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar + neque in porta. Nullam quis lacus orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a. +

+

+ Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at + suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra + non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin + id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis + sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, + vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris + aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. + Aliquam ac convallis enim. +

+

+ Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros + diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id + diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. + Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci + aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat. +

+

+ Nunc faucibus lacus eget odio ultricies nec ullamcorper risus pharetra. Nunc nec consequat urna. + Curabitur condimentum ante vitae erat tristique vitae gravida quam dapibus. Cras ac justo dui, at + faucibus urna. Nunc tristique, velit id feugiat fermentum, dolor enim egestas erat, at vestibulum ante + ipsum vel orci. Duis quis ante id justo vehicula eleifend sed et urna. Sed sapien tortor, rutrum id + ultrices eu, tincidunt tincidunt mi. Etiam blandit, neque eget interdum dignissim, lacus ante facilisis + dolor, non viverra dui lorem vitae nibh. Morbi volutpat augue eget nulla luctus eu aliquam sem + facilisis. Pellentesque sollicitudin commodo dolor sit amet vestibulum. Nam dictum posuere quam, in + tincidunt erat rutrum eu. +

+

+ Etiam nec turpis purus, at lacinia sem. In commodo lacinia euismod. Curabitur tincidunt congue leo, eget + iaculis orci volutpat pharetra. Fusce dignissim lacus lacus. Integer consectetur lacus rutrum risus + malesuada at consectetur erat rutrum. Sed magna ipsum, fringilla eget auctor non, fringilla nec massa. + Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum + nec tortor id nisi luctus aliquam. Maecenas cursus tincidunt ornare. Nulla a vestibulum odio. Mauris + malesuada commodo justo quis mattis. Suspendisse mauris ligula, placerat at egestas in, tincidunt quis + nibh. Aliquam ullamcorper elit at augue cursus quis pellentesque purus viverra. +

+

+ Nulla ultricies justo ac nisi consectetur posuere. Donec ornare pharetra erat, nec facilisis dui cursus + quis. Quisque porttitor porttitor orci, sed facilisis urna facilisis sed. Sed tincidunt adipiscing + turpis et hendrerit. Cras posuere orci ut mauris ullamcorper vitae laoreet nisi luctus. In rutrum + tristique augue. Nam eleifend dignissim dui. +

+

+ Donec viverra egestas tellus non viverra. Aenean est ante, egestas sed scelerisque quis, aliquet sed + lacus. Praesent non mauris neque, et adipiscing ante. Vestibulum quis quam vitae ipsum aliquet blandit. + Vivamus condimentum euismod orci, in tincidunt justo rutrum faucibus. Phasellus nec lorem arcu. Donec + tortor dui, facilisis in rutrum sit amet, pulvinar vitae lacus. Nam sodales sem eu nunc scelerisque + vitae ullamcorper dolor facilisis. Duis imperdiet nisi in magna tempor convallis. Fusce at metus augue. + Quisque dictum tempus mauris, in mattis ligula dignissim ut. +

+

+ Proin sodales, mi at tincidunt ornare, mi dui sagittis velit, sed dictum risus orci eu erat. Sed nunc + leo, congue sed rutrum eget, lobortis ac lectus. Etiam non arcu nulla. Vestibulum rutrum dolor pulvinar + lorem posuere blandit. Sed quis sapien dui. Nunc sagittis erat commodo quam porta cursus in non erat. + Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin a + molestie neque. Aliquam iaculis lacus sed neque hendrerit at dignissim ligula imperdiet. Suspendisse + venenatis, lorem at luctus scelerisque, sem purus pellentesque sapien, vitae ornare ipsum quam nec dui. + Mauris neque est, interdum nec pulvinar eget, dapibus eleifend tellus. Fusce non lorem tortor. Nullam + eget nunc quis felis aliquam consectetur. Aliquam tristique, turpis in feugiat blandit, lectus erat + condimentum tortor, non egestas nisl sapien eget nibh. +

+

+ Aliquam elit turpis, faucibus et porta et, egestas nec nibh. Sed nisl est, pharetra a eleifend a, + pretium ac eros. Sed leo eros, pulvinar vel faucibus dictum, aliquet ut quam. Maecenas et felis non + ligula fringilla pretium fringilla sit amet ante. Nam varius imperdiet interdum. Ut non metus mauris, + vel volutpat lorem. Nullam sagittis est quis lacus feugiat fringilla. Quisque orci lorem, semper ac + accumsan vitae, blandit quis velit. Proin luctus sodales ultrices. Fusce mauris erat, facilisis ut + consectetur at, fringilla feugiat orci. Aliquam a nisi a neque interdum suscipit id eget purus. + Pellentesque tincidunt justo ut urna posuere non molestie quam auctor. +

+
+ +
+
+
+ +
+
+
+
+ +
+ Documentation generated by + JSDoc 3.5.5 on 1st May 2018 using the + FooDoc template. +
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/tutorial-drive-car.html b/__DOCS__/JSDocTemplate/.test/tutorial-drive-car.html index d87c62c..783e192 100644 --- a/__DOCS__/JSDocTemplate/.test/tutorial-drive-car.html +++ b/__DOCS__/JSDocTemplate/.test/tutorial-drive-car.html @@ -1,137 +1,247 @@ - - - - - - - Drive Car - - - - - - - - - - - -
-
-
- -
-

Lorem ipsum dolor sit amet

Curabitur est mi, fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan ac porta tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, mauris vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis commodo.

-

Fusce lacinia, mauris ac aliquam consequat

Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In erat urna, condimentum ac feugiat id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas dignissim nulla in turpis tempus sed rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, dolor metus rhoncus justo, sed semper ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar neque in porta. Nullam quis lacus orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a.

-

Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. Aliquam ac convallis enim.

-

Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat.

-
-
-
- -
-
-
-
- -
Documentation generated by JSDoc 3.5.5 on 1st May 2018 using the FooDoc template.
-
- - - - - - - - - - - - \ No newline at end of file + + + + + + + Drive Car + + + + + + + + + + + + +
+
+
+ +
+
+

Lorem ipsum dolor sit amet

+

+ Curabitur est mi, fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan + ac porta tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, + mauris vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies + porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin + velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis + commodo. +

+

Fusce lacinia, mauris ac aliquam consequat

+

+ Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In erat urna, condimentum ac feugiat + id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas dignissim nulla in turpis tempus sed + rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, dolor metus rhoncus justo, sed semper + ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar neque in porta. Nullam quis lacus + orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a. +

+

+ Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at + suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra + non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin + id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis + sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, + vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris + aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. + Aliquam ac convallis enim. +

+

+ Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros + diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id + diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. + Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci + aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat. +

+
+
+
+
+ +
+
+
+
+ +
+ Documentation generated by + JSDoc 3.5.5 on 1st May 2018 using the + FooDoc template. +
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/.test/tutorial-fence-test.html b/__DOCS__/JSDocTemplate/.test/tutorial-fence-test.html index ef176cd..349c6ae 100644 --- a/__DOCS__/JSDocTemplate/.test/tutorial-fence-test.html +++ b/__DOCS__/JSDocTemplate/.test/tutorial-fence-test.html @@ -1,104 +1,193 @@ - - - - - - - Fence Test - - - - - - - - - - - -
-
-
- -
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non libero tristique, interdum quam in, fermentum massa. Aenean vestibulum velit eu massa faucibus accumsan. Aenean tempus quam ornare ligula gravida adipiscing. Suspendisse vestibulum diam quis quam lacinia convallis. Nunc rhoncus a elit ut dictum. Maecenas porta mi et risus convallis commodo. In hac habitasse platea dictumst. Morbi placerat sem nec eleifend hendrerit. Donec hendrerit pulvinar tristique. Pellentesque at nunc blandit, fringilla elit nec, dignissim arcu. Quisque sit amet enim urna. Nunc adipiscing lacinia justo. Pellentesque euismod nisi id elit auctor porttitor. Phasellus rutrum viverra felis, ac cursus ante vulputate ut. Donec laoreet felis ac risus vulputate sodales.

-

Mauris sit amet risus non ligula lacinia iaculis. Sed ornare tellus velit, vel elementum quam porttitor tempus. Duis vestibulum augue eu diam malesuada auctor. Maecenas dignissim odio ut elit fermentum, id mollis leo mattis. Phasellus posuere augue sed interdum vestibulum. Etiam ac pharetra est. Integer tortor ligula, pharetra ac nisi nec, faucibus laoreet dolor. Nunc vehicula, enim et cursus tincidunt, nulla purus mollis urna, vel ultricies nisl mi a risus. Vestibulum sed urna sodales, pretium nisi sed, pretium sapien. Vivamus et massa tincidunt, semper nibh nec, eleifend urna. Integer auctor, eros at pharetra blandit, erat nibh mattis turpis, rhoncus elementum nisi mi vitae purus.

-

Quisque elementum sapien id neque volutpat cursus non mattis velit.

-
$mod       : function ( qu, value ) {
+
+
+
+  
+    
+    
+    Fence Test
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+
+
+ +
+
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non libero tristique, interdum quam + in, fermentum massa. Aenean vestibulum velit eu massa faucibus accumsan. Aenean tempus quam ornare + ligula gravida adipiscing. Suspendisse vestibulum diam quis quam lacinia convallis. Nunc rhoncus a elit + ut dictum. Maecenas porta mi et risus convallis commodo. In hac habitasse platea dictumst. Morbi + placerat sem nec eleifend hendrerit. Donec hendrerit pulvinar tristique. Pellentesque at nunc blandit, + fringilla elit nec, dignissim arcu. Quisque sit amet enim urna. Nunc adipiscing lacinia justo. + Pellentesque euismod nisi id elit auctor porttitor. Phasellus rutrum viverra felis, ac cursus ante + vulputate ut. Donec laoreet felis ac risus vulputate sodales. +

+

+ Mauris sit amet risus non ligula lacinia iaculis. Sed ornare tellus velit, vel elementum quam porttitor + tempus. Duis vestibulum augue eu diam malesuada auctor. Maecenas dignissim odio ut elit fermentum, id + mollis leo mattis. Phasellus posuere augue sed interdum vestibulum. Etiam ac pharetra est. Integer + tortor ligula, pharetra ac nisi nec, faucibus laoreet dolor. Nunc vehicula, enim et cursus tincidunt, + nulla purus mollis urna, vel ultricies nisl mi a risus. Vestibulum sed urna sodales, pretium nisi sed, + pretium sapien. Vivamus et massa tincidunt, semper nibh nec, eleifend urna. Integer auctor, eros at + pharetra blandit, erat nibh mattis turpis, rhoncus elementum nisi mi vitae purus. +

+

Quisque elementum sapien id neque volutpat cursus non mattis velit.

+
$mod       : function ( qu, value ) {
         var operands = sys.flatten( qu.operands );
         if ( operands.length !== 2 ) {
             throw new Error( "$mod requires two operands" );
@@ -106,12 +195,15 @@ 

Fence Test

var mod = operands[0]; var rem = operands[1]; return value % mod === rem; - },
#!/bin/bash
+    },
+
#!/bin/bash
 echo Please, enter your firstname and lastname
 read FN LN
-echo "Hi! $LN, $FN !"
<div class="my-class test">
+echo "Hi! $LN, $FN !"
+
<div class="my-class test">
     <h1>Weo weo</h1>
-</div>
@font-face {
+</div>
+
@font-face {
   font-family: 'Glyphicons Halflings';
   src: url('../fonts/glyphicons-halflings-regular.eot');
   src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
@@ -142,38 +234,46 @@ 

Fence Test

input::-moz-focus-inner { border: 0; padding: 0; -}
-
-
-
-
-
- -
Documentation generated by JSDoc 3.5.5 on 1st May 2018 using the FooDoc template.
-
- - - - - - - - - - - - \ No newline at end of file +}
+
+
+
+
+
+
+ +
+ Documentation generated by + JSDoc 3.5.5 on 1st May 2018 using the + FooDoc template. +
+
+ + + + + + + + + + + + diff --git a/__DOCS__/JSDocTemplate/Gruntfile.js b/__DOCS__/JSDocTemplate/Gruntfile.js index 1a37b63..dde10dc 100644 --- a/__DOCS__/JSDocTemplate/Gruntfile.js +++ b/__DOCS__/JSDocTemplate/Gruntfile.js @@ -1,264 +1,307 @@ -module.exports = function (grunt) { - - var path = require("path"); - - /** - * Used to process the handlebar template names when compiling them to the "tmpl" namespace. - * @example - * processTemplateName( "src/tmpl/template.hbs" ) => "template" => tmpl["template"] - * processTemplateName( "src/tmpl/_partial.hbs" ) => "partial" => tmpl["partial"] - * processTemplateName( "src/tmpl/group/template.hbs" ) => "group/template" => tmpl["group/template"] - * processTemplateName( "src/tmpl/group/_partial.hbs" ) => "group/partial" => tmpl["group/partial"] - */ - var processTemplateName = function (filePath) { - return filePath.replace(/^.*?\/tmpl\/(.*)?\.hbs/, '$1').replace(/(\/|^)_/, '$1'); - }; - - grunt.initConfig({ - pkg: grunt.file.readJSON('../../package.json'), - clean: { - test: ['.test/'], - examples: ['examples/'], - template: ['template/'] - }, - handlebars: { - compile: { - options: { - namespace: 'tmpl', - node: true, - partialsUseNamespace: true, - processName: processTemplateName, - processPartialName: processTemplateName - }, - files: { - "template/tmpl.js": ["src/tmpl/**/*.hbs"] - } - } - }, - copy: { - template: { - files: [ - {expand: true, flatten: true, src: ['src/conf.json'], dest: 'template/', filter: 'isFile'}, - {expand: true, flatten: true, src: ['src/publish.js'], dest: 'template/', filter: 'isFile'}, - {expand: true, flatten: true, src: ['src/utils/template.js'], dest: 'template/utils/', filter: 'isFile'}, - {expand: true, flatten: true, src: ['src/utils/postProcessor.js'], dest: 'template/utils/', filter: 'isFile'}, - {expand: true, flatten: true, src: ['src/utils/docletHelper.js'], dest: 'template/utils/', filter: 'isFile'}, - { - expand: true, - flatten: true, - src: ['src/utils/handlebarsHelper.js'], - dest: 'template/utils/', - filter: 'isFile' - }, - {expand: true, flatten: true, src: ['src/utils/lunrHelper.js'], dest: 'template/utils/', filter: 'isFile'} - ] - }, - bootstrap: { - files: [ - { - expand: true, - flatten: true, - src: ['../../node_modules/bootstrap/dist/js/bootstrap.min.js'], - dest: 'template/static/js/', - filter: 'isFile' - }, - { - expand: true, - flatten: true, - src: ['../../node_modules/bootstrap/dist/css/bootstrap.min.css'], - dest: 'template/static/css/', - filter: 'isFile' - }, - { - expand: true, - flatten: true, - src: ['../../node_modules/bootstrap/dist/fonts/*'], - dest: 'template/static/fonts/', - filter: 'isFile' - } - ] - }, - jquery: { - files: [ - { - expand: true, - flatten: true, - src: ['../../node_modules/jquery/dist/jquery.min.js'], - dest: 'template/static/js/', - filter: 'isFile' - } - ] - }, - clipboard: { - files: [ - { - expand: true, - flatten: true, - src: ['../../node_modules/clipboard/dist/clipboard.min.js'], - dest: 'template/static/js/', - filter: 'isFile' - } - ] - }, - prism: { - files: [ - { - expand: true, - flatten: true, - src: ['../../node_modules/prismjs/prism.js'], - dest: 'template/static/js/', - filter: 'isFile' - }, - { - expand: true, - flatten: true, - src: ['../../node_modules/prismjs/themes/prism.css'], - dest: 'template/static/css/', - filter: 'isFile' - } - ] - }, - lunr: { - files: [ - { - expand: true, - flatten: true, - src: ['../../node_modules/lunr/lunr.min.js'], - dest: 'template/static/js/', - filter: 'isFile' - } - ] - } - }, - uglify: { - prism: { // prism requires it's own build as I've modified some plugins and use some default ones to. - files: { - 'template/static/js/prism.min.js': [ - 'node_modules/prismjs/prism.js', - 'node_modules/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js', - 'src/static/js/prism-line-numbers.js', - 'src/static/js/prism-toolbar.js', - 'src/static/js/prism-copy-to-clipboard.js', - ] - } - }, - template: { - files: { - 'template/static/js/template.min.js': [ - 'src/static/js/markdown-helpers.js', - 'src/static/js/symbols.js', - 'src/static/js/table-of-contents.js', - 'src/static/js/access-filter.js', - 'src/static/js/lunr-search.js', - 'src/static/js/example-run.js', - 'src/static/js/google-analytics.js' - ] - } - } - }, - cssmin: { - prism: { - files: { - 'template/static/css/prism.min.css': [ - 'node_modules/prismjs/themes/prism.css', - 'src/static/css/prism-theme-overrides.css', - 'src/static/css/prism-line-numbers.css', - 'src/static/css/prism-toolbar.css' - ] - } - }, - template: { - files: { - 'template/static/css/template.min.css': [ - 'src/static/css/site.css', - 'src/static/css/callout.css', - 'src/static/css/page-header.css', - 'src/static/css/symbols.css', - 'src/static/css/tags.css', - 'src/static/css/anchor-link.css', - 'src/static/css/breadcrumbs.css', - 'src/static/css/dummy-console.css', - 'src/static/css/lunr-search.css', - 'src/static/css/related-tutorials.css', - 'src/static/css/toc.css', - 'src/static/css/access-filter.css' - ] - } - } - }, - jsdoc: { - namespaced: { - src: ["README.md", "test-src/namespaced/**/*.js"], - options: { - destination: './.test', - template: './template', - configure: './test-src/default.conf.json', - tutorials: './test-src/fixtures/tutorials/', - private: true - } - }, - default: { - src: ["README.md", "test-src/fixtures/**/*.js"], - options: { - destination: './examples/default', - template: './template', - configure: './test-src/default.conf.json', - tutorials: './test-src/fixtures/tutorials/', - private: true - } - }, - inline: { - src: ["README.md", "test-src/fixtures/**/*.js"], - options: { - destination: './examples/inline', - template: './template', - configure: './test-src/inline.conf.json', - tutorials: './test-src/fixtures/tutorials/', - private: true - } - }, - "logo-color": { - src: ["README.md", "test-src/fixtures/**/*.js"], - options: { - destination: './examples/logo-color', - template: './template', - configure: './test-src/logo-color.conf.json', - tutorials: './test-src/fixtures/tutorials/', - private: true - } - }, - collapse: { - src: ["README.md", "test-src/fixtures/**/*.js"], - options: { - destination: './examples/collapse', - template: './template', - configure: './test-src/collapse.conf.json', - tutorials: './test-src/fixtures/tutorials/', - private: true - } - } - } - }); - - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-handlebars'); - grunt.loadNpmTasks('grunt-jsdoc'); - - grunt.registerTask('template', ['clean:template', 'handlebars', 'copy', 'uglify', 'cssmin']); - - grunt.registerTask('all', ['template', 'clean:examples', 'jsdoc:default', 'jsdoc:inline', 'jsdoc:logo-color', 'jsdoc:collapse', 'jsdoc:namespaced']); - - grunt.registerTask('default', ['template', 'jsdoc:default']); - - grunt.registerTask('inline', ['template', 'jsdoc:inline']); - - grunt.registerTask('logo-color', ['template', 'jsdoc:logo-color']); - - grunt.registerTask('collapse', ['template', 'jsdoc:collapse']); - - grunt.registerTask('namespaced', ['template', 'jsdoc:namespaced']); - -}; +module.exports = function (grunt) { + var path = require("path"); + + /** + * Used to process the handlebar template names when compiling them to the "tmpl" namespace. + * @example + * processTemplateName( "src/tmpl/template.hbs" ) => "template" => tmpl["template"] + * processTemplateName( "src/tmpl/_partial.hbs" ) => "partial" => tmpl["partial"] + * processTemplateName( "src/tmpl/group/template.hbs" ) => "group/template" => tmpl["group/template"] + * processTemplateName( "src/tmpl/group/_partial.hbs" ) => "group/partial" => tmpl["group/partial"] + */ + var processTemplateName = function (filePath) { + return filePath.replace(/^.*?\/tmpl\/(.*)?\.hbs/, "$1").replace(/(\/|^)_/, "$1"); + }; + + grunt.initConfig({ + pkg: grunt.file.readJSON("../../package.json"), + clean: { + test: [".test/"], + examples: ["examples/"], + template: ["template/"], + }, + handlebars: { + compile: { + options: { + namespace: "tmpl", + node: true, + partialsUseNamespace: true, + processName: processTemplateName, + processPartialName: processTemplateName, + }, + files: { + "template/tmpl.js": ["src/tmpl/**/*.hbs"], + }, + }, + }, + copy: { + template: { + files: [ + { + expand: true, + flatten: true, + src: ["src/conf.json"], + dest: "template/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["src/publish.js"], + dest: "template/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["src/utils/template.js"], + dest: "template/utils/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["src/utils/postProcessor.js"], + dest: "template/utils/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["src/utils/docletHelper.js"], + dest: "template/utils/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["src/utils/handlebarsHelper.js"], + dest: "template/utils/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["src/utils/lunrHelper.js"], + dest: "template/utils/", + filter: "isFile", + }, + ], + }, + bootstrap: { + files: [ + { + expand: true, + flatten: true, + src: ["../../node_modules/bootstrap/dist/js/bootstrap.min.js"], + dest: "template/static/js/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["../../node_modules/bootstrap/dist/css/bootstrap.min.css"], + dest: "template/static/css/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["../../node_modules/bootstrap/dist/fonts/*"], + dest: "template/static/fonts/", + filter: "isFile", + }, + ], + }, + jquery: { + files: [ + { + expand: true, + flatten: true, + src: ["../../node_modules/jquery/dist/jquery.min.js"], + dest: "template/static/js/", + filter: "isFile", + }, + ], + }, + clipboard: { + files: [ + { + expand: true, + flatten: true, + src: ["../../node_modules/clipboard/dist/clipboard.min.js"], + dest: "template/static/js/", + filter: "isFile", + }, + ], + }, + prism: { + files: [ + { + expand: true, + flatten: true, + src: ["../../node_modules/prismjs/prism.js"], + dest: "template/static/js/", + filter: "isFile", + }, + { + expand: true, + flatten: true, + src: ["../../node_modules/prismjs/themes/prism.css"], + dest: "template/static/css/", + filter: "isFile", + }, + ], + }, + lunr: { + files: [ + { + expand: true, + flatten: true, + src: ["../../node_modules/lunr/lunr.min.js"], + dest: "template/static/js/", + filter: "isFile", + }, + ], + }, + }, + uglify: { + prism: { + // prism requires it's own build as I've modified some plugins and use some default ones to. + files: { + "template/static/js/prism.min.js": [ + "node_modules/prismjs/prism.js", + "node_modules/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js", + "src/static/js/prism-line-numbers.js", + "src/static/js/prism-toolbar.js", + "src/static/js/prism-copy-to-clipboard.js", + ], + }, + }, + template: { + files: { + "template/static/js/template.min.js": [ + "src/static/js/markdown-helpers.js", + "src/static/js/symbols.js", + "src/static/js/table-of-contents.js", + "src/static/js/access-filter.js", + "src/static/js/lunr-search.js", + "src/static/js/example-run.js", + "src/static/js/google-analytics.js", + ], + }, + }, + }, + cssmin: { + prism: { + files: { + "template/static/css/prism.min.css": [ + "node_modules/prismjs/themes/prism.css", + "src/static/css/prism-theme-overrides.css", + "src/static/css/prism-line-numbers.css", + "src/static/css/prism-toolbar.css", + ], + }, + }, + template: { + files: { + "template/static/css/template.min.css": [ + "src/static/css/site.css", + "src/static/css/callout.css", + "src/static/css/page-header.css", + "src/static/css/symbols.css", + "src/static/css/tags.css", + "src/static/css/anchor-link.css", + "src/static/css/breadcrumbs.css", + "src/static/css/dummy-console.css", + "src/static/css/lunr-search.css", + "src/static/css/related-tutorials.css", + "src/static/css/toc.css", + "src/static/css/access-filter.css", + ], + }, + }, + }, + jsdoc: { + namespaced: { + src: ["README.md", "test-src/namespaced/**/*.js"], + options: { + destination: "./.test", + template: "./template", + configure: "./test-src/default.conf.json", + tutorials: "./test-src/fixtures/tutorials/", + private: true, + }, + }, + default: { + src: ["README.md", "test-src/fixtures/**/*.js"], + options: { + destination: "./examples/default", + template: "./template", + configure: "./test-src/default.conf.json", + tutorials: "./test-src/fixtures/tutorials/", + private: true, + }, + }, + inline: { + src: ["README.md", "test-src/fixtures/**/*.js"], + options: { + destination: "./examples/inline", + template: "./template", + configure: "./test-src/inline.conf.json", + tutorials: "./test-src/fixtures/tutorials/", + private: true, + }, + }, + "logo-color": { + src: ["README.md", "test-src/fixtures/**/*.js"], + options: { + destination: "./examples/logo-color", + template: "./template", + configure: "./test-src/logo-color.conf.json", + tutorials: "./test-src/fixtures/tutorials/", + private: true, + }, + }, + collapse: { + src: ["README.md", "test-src/fixtures/**/*.js"], + options: { + destination: "./examples/collapse", + template: "./template", + configure: "./test-src/collapse.conf.json", + tutorials: "./test-src/fixtures/tutorials/", + private: true, + }, + }, + }, + }); + + grunt.loadNpmTasks("grunt-contrib-clean"); + grunt.loadNpmTasks("grunt-contrib-copy"); + grunt.loadNpmTasks("grunt-contrib-cssmin"); + grunt.loadNpmTasks("grunt-contrib-uglify"); + grunt.loadNpmTasks("grunt-contrib-handlebars"); + grunt.loadNpmTasks("grunt-jsdoc"); + + grunt.registerTask("template", ["clean:template", "handlebars", "copy", "uglify", "cssmin"]); + + grunt.registerTask("all", [ + "template", + "clean:examples", + "jsdoc:default", + "jsdoc:inline", + "jsdoc:logo-color", + "jsdoc:collapse", + "jsdoc:namespaced", + ]); + + grunt.registerTask("default", ["template", "jsdoc:default"]); + + grunt.registerTask("inline", ["template", "jsdoc:inline"]); + + grunt.registerTask("logo-color", ["template", "jsdoc:logo-color"]); + + grunt.registerTask("collapse", ["template", "jsdoc:collapse"]); + + grunt.registerTask("namespaced", ["template", "jsdoc:namespaced"]); +}; diff --git a/__DOCS__/JSDocTemplate/README.md b/__DOCS__/JSDocTemplate/README.md index 3583894..d1eb127 100644 --- a/__DOCS__/JSDocTemplate/README.md +++ b/__DOCS__/JSDocTemplate/README.md @@ -1,325 +1,343 @@ -[![NPM](https://nodei.co/npm/foodoc.png?downloads=true)](https://nodei.co/npm/foodoc/) - -[![Dependency Status](https://img.shields.io/david/steveush/foodoc.svg)](https://david-dm.org/steveush/foodoc) [![devDependency Status](https://img.shields.io/david/dev/steveush/foodoc.svg)](https://david-dm.org/steveush/foodoc#info=devDependencies) [![Donate](https://img.shields.io/badge/Donate-PayPal-brightgreen.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DHYUFBMRBJLTW) - -# FooDoc - -FooDoc is a [Bootstrap](http://twitter.github.io/bootstrap/index.html) and [Handlebars](http://handlebarsjs.com/) based template for [JSDoc3](http://usejsdoc.org/). A big thanks must go out to [DocStrap](https://github.com/docstrap/docstrap) as it served as the inspiration for this project. - -This project began as a simple modification of DocStrap. Removing the Bootswatch support in favor of my own CSS customizations but it ended up with me re-writing pretty much the entire template, even switching out the template engine to Handlebars. - -## Features - -* Right side Table of Contents which auto hides on pages it's not required on. -* Basic themeing is supported through the `systemColor` option and if required further customizations can be supplied using the `stylesheets` and `scripts` options. -* Integrated offline search across all doclets and there members (excludes source files). -* Syntax highlighting using [Prism](https://github.com/PrismJS/prism) . -* Breadcrumbs on every page for easy navigation. -* Handlebars template engine using precompiled templates to generate documentation. -* Extended tutorial configuration through the standard `.json` file approach supported by JSDoc allowing you to supply a structure as well as title and summary info for tutorials. -* Configurable navbar links including support for larger systems by switching to list pages with the `inlineNav` option instead of the usual drop downs. -* Responsive design, the generated documentation works across both desktop and mobile devices thanks to Bootstrap. -* Makes use of the JSDoc `@summary` tag where appropriate, this tag now also supports markdown syntax. - -### What it looks like - -As this started off as a DocStrap modification I've used it's `fixtures` code to generate the sample documentation so you can compare the differences between the two. - -**NOTE:** The `fixtures` code doesn't make use of the `@summary` tag when describing it's members so it may look a little sparse. - -* [The default template options](http://steveush.github.io/foodoc/examples/default) -* [The template with the `inlineNav` option set to `true`](http://steveush.github.io/foodoc/examples/inline) -* [The template using the `systemLogo` and `systemColor` options](http://steveush.github.io/foodoc/examples/logo-color) -* [The template with the `collapseSymbols` option set to `false`](http://steveush.github.io/foodoc/examples/collapse) - -## Ooooh, I want it! How do I get it? - -If you manage your own version of jsdoc: - -```bash -npm install foodoc -``` - -When using [grunt](http://gruntjs.com/), please look at [grunt-jsdoc](https://github.com/krampstudio/grunt-jsdoc) which you can use with FooDoc. - -### Command line example - -```bash -jsdoc -c path/to/conf.json -t ./node_modules/foodoc/template -R README.md -r . -``` - -The `-c` sets the config, the options you can supply in the templates object are listed below in the options. - -The `-t` sets the template. This is the option you need to set to get the FooDoc template to be used. - -The `-R` sets a markdown file to be the front page of the documentation. - -The `-r` tells jsdoc to run recursively. - -The `.` says from current directory. - -## Configuring the template - -FooDoc ships with a `conf.json` file in the template/ directory. It is just a regular old [JSDoc configuration file](http://usejsdoc.org/about-configuring-jsdoc.html), but with the following new options: - -```javascript -"templates": { - "systemName" : "{string}", - "systemSummary" : "{string}", - "systemLogo" : "{string}", - "systemColor" : "{string}", - "footer" : "{string}", - "copyright" : "{string}", - "includeDate" : "{boolean}", - "dateFormat" : "{string}", - "inlineNav" : "{boolean}", - "inverseNav" : "{boolean}", - "navMembers" : "{array.}", - "linenums" : "{boolean}", - "showTableOfContents" : "{boolean}", - "showAccessFilter" : "{boolean}", - "analytics" : "{object}", - "collapseSymbols" : "{boolean}", - "methodHeadingReturns" : "{boolean}", - "outputSourceFiles" : "{boolean}", - "outputSourcePath" : "{boolean}", - "sort" : "{boolean|string}", - "search" : "{boolean}", - "favicon" : "{string}", - "stylesheets" : "{array.}", - "scripts" : "{array.}" -} -``` - -### Options - -* __systemName - `"FooDoc"`__ - The name of the system being documented. This value is used to generate the *home* link in the navbar and the page title for the generated README page. -* __systemSummary - `"A Bootstrap and Handlebars based JSDoc3 template."`__ - The short summary description of the system being documented. This is used as part of the page title for the generated README page. -* __systemLogo - `""`__ - A small 40x40 pixel image to used in the navbar along with the `systemName` to create the *home* link. -* __systemColor - `""`__ - The primary color used to generate the documentation. This changes the background color of the jumbotron-esque headers on every page, the primary callout border and header colors, the TOC link colors and various other small highlights. -* __footer - `""`__ - Additional content to place in the footer element of each page before the `copyright` and default *generated by* messages. This can contain HTML. -* __copyright - `"FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects."`__ - A copyright message to display in the footer of each page throughout the documentation. This can contain HTML. -* __includeDate - `true`__ - Whether or not the date is included as part of the *generated by* message. -* __dateFormat - `Do MMM YYYY`__ - If `includeDate` is true this is the format used to display the date. This makes use of moment.js so any format it supports should be supported here. -* __inlineNav - `false`__ - If your system is quite large the navbar drop downs just don't look good, setting this option to true changes these drop downs to instead just be a link to a list page. -* __inverseNav - `true`__ - Bootstrap navbars support an inverse mode, this toggles that option for the documentation navbar with `true` being the dark version. -* __navMembers__ - This option allows you to specify which kinds of documents appear in the navbar, give them a title and provide a short summary which is then used as part of the `inlineNav` option to generate the list pages. The following shows the default values for this option, you can remove from this array but cannot add new kinds without altering the template. If no documents are registered for a specific kind it is not added to the navbar. - ```javascript - [ - {"kind": "class", "title": "Classes", "summary": "All documented classes."}, - {"kind": "external", "title": "Externals", "summary": "All documented external members."}, - {"kind": "global", "title": "Globals", "summary": "All documented globals."}, - {"kind": "mixin", "title": "Mixins", "summary": "All documented mixins."}, - {"kind": "interface", "title": "Interfaces", "summary": "All documented interfaces."}, - {"kind": "module", "title": "Modules", "summary": "All documented modules."}, - {"kind": "namespace", "title": "Namespaces", "summary": "All documented namespaces."}, - {"kind": "tutorial", "title": "Tutorials", "summary": "All available tutorials."} - ] - ``` -* __outputSourceFiles - `true`__ - Whether or not to output pretty printed source file documentation that is linked to from other documents. -* __outputSourcePath - `true`__ - When `outputSourceFiles` is `false`, you may still want to name the file even without a link to the pretty printed output. Set this to `true` when `outputSourceFiles` is `false`. `outputSourceFiles` when `true` takes precedence over this setting. -* __linenums - `true`__ - When `true`, line numbers will appear in any pretty printed source code blocks. If `outputSourceFiles` is `true` this will add an additional link to all documented members pointing to the exact line number in the pretty printed source file the documentation was pulled from. -* __showTableOfContents - `true`__ - When `true`, a TOC is generated from all `H1`, `H2`, `H3` and `H4` headings in the generated pages, this includes the README and tutorial pages. If you want to disable this for specific tutorial pages you can set this same option per tutorial in the extended tutorial configuration. -* __showAccessFilter - `true`__ - When `true`, a checkbox list is displayed allowing the user to toggle the visibility of inherited, public, protected and private symbols of the current doclet. Each checkbox will only be displayed if the doclet contains at least one symbol of that type. If there is only a single type available across the entire doclet the filter is not displayed at all. -* __analytics - `null`__ - Adds a [Google Analytics](http://www.google.com/analytics) code block to the template output - _e.g._ `"analytics":{"ua":"UA-XXXXX-XXX", "domain":"XXXX"}` - * __ua__ The google agent (see Google Analytics help for details) - * __domain__ The domain being served. (see Google Analytics help for details) - -* __collapseSymbols - `true`__ - When `true`, symbols in generated pages (methods, members, type definitions, etc.) are collapsed so only there title and summary are visible. You can then click on them to reveal more detailed information. -* __methodHeadingReturns - `true`__ - When `true`, method headings will contain the return type if one exists. -* __sort - `"linenum, longname, version, since"`__ - Specifies the sort order of the symbols on a page. They will still be grouped under there own headings (Classes, Members, Methods, etc.) but within these groups they are sorted using the supplied value. By default this sorts symbols first by where they were found in the original source code, then by there longname, then by there version and lastly by there since tag. -* __search - `true`__ - Whether or not to enable the lunr search component. -* __favicon - `null`__ - An image or favicon that will be used as favicon. -* __stylesheets - `[]`__ - An array of stylesheet urls to include in every page. -* __scripts - `[]`__ - An array of script urls to include in every page. - -### Extended tutorial configuration - -[JSDoc supports providing a `.json` file in your tutorials directory](http://usejsdoc.org/about-tutorials.html) to configure the hierarchical structure and title for tutorials. This template adds two new options to each tutorial in this file. - -* __summary__ - A short summary of the tutorial which is used in various places throughout the documentation, most notably in the page header of the tutorial itself. -* __showTableOfContents__ - A boolean value indicating whether or not to generate the Table of Contents for this specific tutorial. - -The following shows what the `tutorials.json` in the `fixtures` test code contains. - -**NOTE:** The array based syntax for child tutorials is not supported at present and children must be supplied as properties of an object. - -```javascript -{ - "brush-teeth": { - "title": "Brush Teeth", - "summary": "How to brush your teeth!", - "children": { - "fence-test": { - "title": "Fence Test", - "summary": "Testing syntax highlighting.", - "showTableOfContents": false - } - } - }, - "drive-car": { - "title": "Drive Car", - "summary": "How to drive a car!" - } -} -``` - -### Syntax highlighting - -FooDoc uses [Prism](https://github.com/PrismJS/prism) to provide syntax highlighting and supports a couple of ways to specify which language to use. - -* The standard markdown syntax is supported. - -
```html
-<html></html>
-```
- -* Or when using an `@example` tag in your comments you can add a custom inner tag `{@lang languageName}` where `languageName` is one of the default languages supported by Prism (Markup, CSS, C-Like and JavaScript languages are supported by default). You can add this tag anywhere within an `@example` tags body but keep in mind that there is no white-space processing performed when it is removed prior to rendering. - - ```javascript - /** - * @example {@lang html} - */ - ``` - -If you need to use a language provided by a Prism plugin you will need to fork the template and add in the specific language yourself. Take a look at the [Prism documentation](http://prismjs.com/index.html#languages-list) to see a full list of all 119 supported languages. - -## FAQ - -### Why another template? - -Over the years I have tried quite a few templates available for JSDoc and none of them produced a look I was quite happy with. Some got close like DocStrap, but I still wasn't quite satisfied so I did what all developers do eventually, roll their own. I really liked the clean look of the Bootstrap 3 documentation so I used it as base for the layout and styling for this template. - -### Why Handlebars? - -Personal preference really, Underscore templates work great but due to there ability to have basically any JavaScript in them I've noticed a lot logic which should be handled elsewhere creep into them overtime. It's simply easier to hack it into the template than find where it should be implemented as part of the post processing. - -### What's different from DocStrap's search? - -The [lunr](http://lunrjs.com/) search implementation in DocStrap performs all the indexing in the browser using a hidden iframe, this was done to allow the search to work offline when viewing the documentation via the `file://` protocol. It does however have the drawback of loading and then indexing what could potentially be a large numbers of documents, on every page load. - -While this works I took a different approach and decided to generate the search index and store as part of the documentation process and output the results in two files `lunr-data.json` and `lunr-data.js`. These two files are then consumed by the search component when required. The `lunr-data.json` file is fetched via ajax request if the documentation is served via `http://` or `https://` protocols while the `lunr-data.js` file is simply included into the page when using the `file://` protocol as you can't perform ajax requests. This ultimately provides us with two primary benefits over DocStrap's implementation: - -1. All indexing of documents is performed only once, when the documentation itself is generated. Due to creating the index directly from the JSDoc doclets it contains more detailed information, including information on members, methods and type definitions, leading to better search results where you can click on a method name and be taken directly to it's documentation. -2. The index and store information is only loaded into the page when a user performs a search, this greatly improves load speeds. - -The following shows the lunr index fields implemented by this template: - -```javascript -var index = lunr(function(){ - this.field('longname', {boost: 1000}); - this.field('name', {boost: 500}); - this.field('tags', {boost: 300}); - this.field('kind', {boost: 110}); - this.field('title', {boost: 100}); - this.field('summary', {boost: 70}); - this.field('description', {boost: 50}); - this.field('body'); - this.ref('id'); -}); -``` - -* __longname__ - This is basically a doclet id and is the fully qualified name of a documented symbol. e.g. `MyApi.utils.fetch` or `MyApi.Class#fetch`. This has the highest weighting of 1000 as if someone types in the exact longname it should be the first result! -* __name__ - This is the short or "friendly" name of a doclet, using the two examples from above (`MyApi.utils.fetch` or `MyApi.Class#fetch`) they would both have the same name of `fetch`. -* __tags__ - This is a space delimited string of any tags generated for the doclet. At present this simply provides multiple variations of the longname to aid in searching, for example the longname `MyApi.utils#fetch` would be added to the tags as the following; `utils#fetch fetch`. -* __kind__ - This is the kind or type of the doclet (class, namespace, function, etc.). -* __title__ - This is the page title the doclet uses when generating a page. -* __summary__ - This is the HTML sanitized doclet summary, in the case of a tutorial or the readme this is the summary value supplied through either the extended configuration or options. -* __description__ - This is the HTML sanitized doclet description. -* __body__ - This is the full text of the main content section of the generated HTML for the doclet. Any matches against this have the lowest possible weighting. - -### Why Prism instead of Sunlight? - -Quite simply Sunlight is no longer maintained and while it does work I prefer Prism which is actively maintained and follows HTML5 standards. - -## To Do - -* Refactor and document the template source code. Now that I know how it all works I can slim down source code and then heavily document it so I can use it as the example documentation. - -## Changelog - -All releases prior to 1.0.0 are considered pre-release, i.e. I'm not finished changing stuff yet so anything can happen ;) - -### 0.0.9 - -* Fixed issue with the `footer` option not rendering HTML as it was intended. -* Fixed the missing `global.html` issue. -* Updated the `copyright` option to also allow HTML in it's content. -* Updated the `_navbar.hbs` so that if an item has no members it is simply rendered as a link instead of an empty dropdown. -* Updated the base CSS to apply a background color to the `` element that matches the footer. This stops the page looking 'incomplete' or 'broken' as there is no longer any whitespace below the footer. - -### 0.0.8 - -* Updated the navbar dropdowns and the table of contents to handle long lists. If the list exceeds the viewport it now displays a scrollbar. (@mistic100) -* Fixed missing Google Analytics code in the `_layout.hbs`. (@mistic100) -* Added the `favicon` option allowing you to supply a path to an image or icon to use as the favicon for the documentation. (@mistic100) -* Added the `showAccessFilter` option which allows users to filter the symbols of a doclet in real-time by if they are inherited, public, protected or private. - -### 0.0.7 - -* Fixed Prism CSS conflict with `.namespace` class. -* Updated Gruntfile to compile and minify all used prism files (including customized plugins) into single includes. -* Added in the Prism Normalize Whitespace plugin to perform some additional processing to clean up any extra whitespace in examples. - -### 0.0.6 - -* Replaced Sunlight syntax highlighter with Prism as it is maintained and it's just generally better. - -### 0.0.5 - -* Updated TOC to align with crumbs. -* Fixed anchor-links not showing on hover. -* Updated the search input size to match the TOC. - -### 0.0.4 - -* Added missing {@run } javascript and css as well as some additional styling for related tutorials. - -### 0.0.3 - -* Fixed page symbols not generating details correctly when displayed as primary header. - -### 0.0.2 - -* Fixed missing moment.js dependency in the npm package. -* Added .npmignore to exclude the generated examples directory. -* Updated the lunrHelper.js to write files directly to the output directory instead of to the template/static one and then copying it across. - -### 0.0.1 - -* Initial check in of template. \ No newline at end of file +[![NPM](https://nodei.co/npm/foodoc.png?downloads=true)](https://nodei.co/npm/foodoc/) + +[![Dependency Status](https://img.shields.io/david/steveush/foodoc.svg)](https://david-dm.org/steveush/foodoc) [![devDependency Status](https://img.shields.io/david/dev/steveush/foodoc.svg)](https://david-dm.org/steveush/foodoc#info=devDependencies) [![Donate](https://img.shields.io/badge/Donate-PayPal-brightgreen.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DHYUFBMRBJLTW) + +# FooDoc + +FooDoc is a [Bootstrap](http://twitter.github.io/bootstrap/index.html) and [Handlebars](http://handlebarsjs.com/) based template for [JSDoc3](http://usejsdoc.org/). A big thanks must go out to [DocStrap](https://github.com/docstrap/docstrap) as it served as the inspiration for this project. + +This project began as a simple modification of DocStrap. Removing the Bootswatch support in favor of my own CSS customizations but it ended up with me re-writing pretty much the entire template, even switching out the template engine to Handlebars. + +## Features + +- Right side Table of Contents which auto hides on pages it's not required on. +- Basic themeing is supported through the `systemColor` option and if required further customizations can be supplied using the `stylesheets` and `scripts` options. +- Integrated offline search across all doclets and there members (excludes source files). +- Syntax highlighting using [Prism](https://github.com/PrismJS/prism) . +- Breadcrumbs on every page for easy navigation. +- Handlebars template engine using precompiled templates to generate documentation. +- Extended tutorial configuration through the standard `.json` file approach supported by JSDoc allowing you to supply a structure as well as title and summary info for tutorials. +- Configurable navbar links including support for larger systems by switching to list pages with the `inlineNav` option instead of the usual drop downs. +- Responsive design, the generated documentation works across both desktop and mobile devices thanks to Bootstrap. +- Makes use of the JSDoc `@summary` tag where appropriate, this tag now also supports markdown syntax. + +### What it looks like + +As this started off as a DocStrap modification I've used it's `fixtures` code to generate the sample documentation so you can compare the differences between the two. + +**NOTE:** The `fixtures` code doesn't make use of the `@summary` tag when describing it's members so it may look a little sparse. + +- [The default template options](http://steveush.github.io/foodoc/examples/default) +- [The template with the `inlineNav` option set to `true`](http://steveush.github.io/foodoc/examples/inline) +- [The template using the `systemLogo` and `systemColor` options](http://steveush.github.io/foodoc/examples/logo-color) +- [The template with the `collapseSymbols` option set to `false`](http://steveush.github.io/foodoc/examples/collapse) + +## Ooooh, I want it! How do I get it? + +If you manage your own version of jsdoc: + +```bash +npm install foodoc +``` + +When using [grunt](http://gruntjs.com/), please look at [grunt-jsdoc](https://github.com/krampstudio/grunt-jsdoc) which you can use with FooDoc. + +### Command line example + +```bash +jsdoc -c path/to/conf.json -t ./node_modules/foodoc/template -R README.md -r . +``` + +The `-c` sets the config, the options you can supply in the templates object are listed below in the options. + +The `-t` sets the template. This is the option you need to set to get the FooDoc template to be used. + +The `-R` sets a markdown file to be the front page of the documentation. + +The `-r` tells jsdoc to run recursively. + +The `.` says from current directory. + +## Configuring the template + +FooDoc ships with a `conf.json` file in the template/ directory. It is just a regular old [JSDoc configuration file](http://usejsdoc.org/about-configuring-jsdoc.html), but with the following new options: + +```javascript +"templates": { + "systemName" : "{string}", + "systemSummary" : "{string}", + "systemLogo" : "{string}", + "systemColor" : "{string}", + "footer" : "{string}", + "copyright" : "{string}", + "includeDate" : "{boolean}", + "dateFormat" : "{string}", + "inlineNav" : "{boolean}", + "inverseNav" : "{boolean}", + "navMembers" : "{array.}", + "linenums" : "{boolean}", + "showTableOfContents" : "{boolean}", + "showAccessFilter" : "{boolean}", + "analytics" : "{object}", + "collapseSymbols" : "{boolean}", + "methodHeadingReturns" : "{boolean}", + "outputSourceFiles" : "{boolean}", + "outputSourcePath" : "{boolean}", + "sort" : "{boolean|string}", + "search" : "{boolean}", + "favicon" : "{string}", + "stylesheets" : "{array.}", + "scripts" : "{array.}" +} +``` + +### Options + +- **systemName - `"FooDoc"`** + The name of the system being documented. This value is used to generate the _home_ link in the navbar and the page title for the generated README page. +- **systemSummary - `"A Bootstrap and Handlebars based JSDoc3 template."`** + The short summary description of the system being documented. This is used as part of the page title for the generated README page. +- **systemLogo - `""`** + A small 40x40 pixel image to used in the navbar along with the `systemName` to create the _home_ link. +- **systemColor - `""`** + The primary color used to generate the documentation. This changes the background color of the jumbotron-esque headers on every page, the primary callout border and header colors, the TOC link colors and various other small highlights. +- **footer - `""`** + Additional content to place in the footer element of each page before the `copyright` and default _generated by_ messages. This can contain HTML. +- **copyright - `"FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects."`** + A copyright message to display in the footer of each page throughout the documentation. This can contain HTML. +- **includeDate - `true`** + Whether or not the date is included as part of the _generated by_ message. +- **dateFormat - `Do MMM YYYY`** + If `includeDate` is true this is the format used to display the date. This makes use of moment.js so any format it supports should be supported here. +- **inlineNav - `false`** + If your system is quite large the navbar drop downs just don't look good, setting this option to true changes these drop downs to instead just be a link to a list page. +- **inverseNav - `true`** + Bootstrap navbars support an inverse mode, this toggles that option for the documentation navbar with `true` being the dark version. +- **navMembers** + This option allows you to specify which kinds of documents appear in the navbar, give them a title and provide a short summary which is then used as part of the `inlineNav` option to generate the list pages. The following shows the default values for this option, you can remove from this array but cannot add new kinds without altering the template. If no documents are registered for a specific kind it is not added to the navbar. + ```javascript + [ + { kind: "class", title: "Classes", summary: "All documented classes." }, + { + kind: "external", + title: "Externals", + summary: "All documented external members.", + }, + { kind: "global", title: "Globals", summary: "All documented globals." }, + { kind: "mixin", title: "Mixins", summary: "All documented mixins." }, + { + kind: "interface", + title: "Interfaces", + summary: "All documented interfaces.", + }, + { kind: "module", title: "Modules", summary: "All documented modules." }, + { + kind: "namespace", + title: "Namespaces", + summary: "All documented namespaces.", + }, + { + kind: "tutorial", + title: "Tutorials", + summary: "All available tutorials.", + }, + ]; + ``` +- **outputSourceFiles - `true`** + Whether or not to output pretty printed source file documentation that is linked to from other documents. +- **outputSourcePath - `true`** + When `outputSourceFiles` is `false`, you may still want to name the file even without a link to the pretty printed output. Set this to `true` when `outputSourceFiles` is `false`. `outputSourceFiles` when `true` takes precedence over this setting. +- **linenums - `true`** + When `true`, line numbers will appear in any pretty printed source code blocks. If `outputSourceFiles` is `true` this will add an additional link to all documented members pointing to the exact line number in the pretty printed source file the documentation was pulled from. +- **showTableOfContents - `true`** + When `true`, a TOC is generated from all `H1`, `H2`, `H3` and `H4` headings in the generated pages, this includes the README and tutorial pages. If you want to disable this for specific tutorial pages you can set this same option per tutorial in the extended tutorial configuration. +- **showAccessFilter - `true`** + When `true`, a checkbox list is displayed allowing the user to toggle the visibility of inherited, public, protected and private symbols of the current doclet. Each checkbox will only be displayed if the doclet contains at least one symbol of that type. If there is only a single type available across the entire doclet the filter is not displayed at all. +- **analytics - `null`** + Adds a [Google Analytics](http://www.google.com/analytics) code block to the template output + _e.g._ `"analytics":{"ua":"UA-XXXXX-XXX", "domain":"XXXX"}` + + - **ua** The google agent (see Google Analytics help for details) + - **domain** The domain being served. (see Google Analytics help for details) + +- **collapseSymbols - `true`** + When `true`, symbols in generated pages (methods, members, type definitions, etc.) are collapsed so only there title and summary are visible. You can then click on them to reveal more detailed information. +- **methodHeadingReturns - `true`** + When `true`, method headings will contain the return type if one exists. +- **sort - `"linenum, longname, version, since"`** + Specifies the sort order of the symbols on a page. They will still be grouped under there own headings (Classes, Members, Methods, etc.) but within these groups they are sorted using the supplied value. By default this sorts symbols first by where they were found in the original source code, then by there longname, then by there version and lastly by there since tag. +- **search - `true`** + Whether or not to enable the lunr search component. +- **favicon - `null`** + An image or favicon that will be used as favicon. +- **stylesheets - `[]`** + An array of stylesheet urls to include in every page. +- **scripts - `[]`** + An array of script urls to include in every page. + +### Extended tutorial configuration + +[JSDoc supports providing a `.json` file in your tutorials directory](http://usejsdoc.org/about-tutorials.html) to configure the hierarchical structure and title for tutorials. This template adds two new options to each tutorial in this file. + +- **summary** + A short summary of the tutorial which is used in various places throughout the documentation, most notably in the page header of the tutorial itself. +- **showTableOfContents** + A boolean value indicating whether or not to generate the Table of Contents for this specific tutorial. + +The following shows what the `tutorials.json` in the `fixtures` test code contains. + +**NOTE:** The array based syntax for child tutorials is not supported at present and children must be supplied as properties of an object. + +```javascript +{ + "brush-teeth": { + "title": "Brush Teeth", + "summary": "How to brush your teeth!", + "children": { + "fence-test": { + "title": "Fence Test", + "summary": "Testing syntax highlighting.", + "showTableOfContents": false + } + } + }, + "drive-car": { + "title": "Drive Car", + "summary": "How to drive a car!" + } +} +``` + +### Syntax highlighting + +FooDoc uses [Prism](https://github.com/PrismJS/prism) to provide syntax highlighting and supports a couple of ways to specify which language to use. + +- The standard markdown syntax is supported. + +
```html
+
+  <html></html>
+  ```
+ +- Or when using an `@example` tag in your comments you can add a custom inner tag `{@lang languageName}` where `languageName` is one of the default languages supported by Prism (Markup, CSS, C-Like and JavaScript languages are supported by default). You can add this tag anywhere within an `@example` tags body but keep in mind that there is no white-space processing performed when it is removed prior to rendering. + + ```javascript + /** + * @example {@lang html} + */ + ``` + +If you need to use a language provided by a Prism plugin you will need to fork the template and add in the specific language yourself. Take a look at the [Prism documentation](http://prismjs.com/index.html#languages-list) to see a full list of all 119 supported languages. + +## FAQ + +### Why another template? + +Over the years I have tried quite a few templates available for JSDoc and none of them produced a look I was quite happy with. Some got close like DocStrap, but I still wasn't quite satisfied so I did what all developers do eventually, roll their own. I really liked the clean look of the Bootstrap 3 documentation so I used it as base for the layout and styling for this template. + +### Why Handlebars? + +Personal preference really, Underscore templates work great but due to there ability to have basically any JavaScript in them I've noticed a lot logic which should be handled elsewhere creep into them overtime. It's simply easier to hack it into the template than find where it should be implemented as part of the post processing. + +### What's different from DocStrap's search? + +The [lunr](http://lunrjs.com/) search implementation in DocStrap performs all the indexing in the browser using a hidden iframe, this was done to allow the search to work offline when viewing the documentation via the `file://` protocol. It does however have the drawback of loading and then indexing what could potentially be a large numbers of documents, on every page load. + +While this works I took a different approach and decided to generate the search index and store as part of the documentation process and output the results in two files `lunr-data.json` and `lunr-data.js`. These two files are then consumed by the search component when required. The `lunr-data.json` file is fetched via ajax request if the documentation is served via `http://` or `https://` protocols while the `lunr-data.js` file is simply included into the page when using the `file://` protocol as you can't perform ajax requests. This ultimately provides us with two primary benefits over DocStrap's implementation: + +1. All indexing of documents is performed only once, when the documentation itself is generated. Due to creating the index directly from the JSDoc doclets it contains more detailed information, including information on members, methods and type definitions, leading to better search results where you can click on a method name and be taken directly to it's documentation. +2. The index and store information is only loaded into the page when a user performs a search, this greatly improves load speeds. + +The following shows the lunr index fields implemented by this template: + +```javascript +var index = lunr(function () { + this.field("longname", { boost: 1000 }); + this.field("name", { boost: 500 }); + this.field("tags", { boost: 300 }); + this.field("kind", { boost: 110 }); + this.field("title", { boost: 100 }); + this.field("summary", { boost: 70 }); + this.field("description", { boost: 50 }); + this.field("body"); + this.ref("id"); +}); +``` + +- **longname** + This is basically a doclet id and is the fully qualified name of a documented symbol. e.g. `MyApi.utils.fetch` or `MyApi.Class#fetch`. This has the highest weighting of 1000 as if someone types in the exact longname it should be the first result! +- **name** + This is the short or "friendly" name of a doclet, using the two examples from above (`MyApi.utils.fetch` or `MyApi.Class#fetch`) they would both have the same name of `fetch`. +- **tags** + This is a space delimited string of any tags generated for the doclet. At present this simply provides multiple variations of the longname to aid in searching, for example the longname `MyApi.utils#fetch` would be added to the tags as the following; `utils#fetch fetch`. +- **kind** + This is the kind or type of the doclet (class, namespace, function, etc.). +- **title** + This is the page title the doclet uses when generating a page. +- **summary** + This is the HTML sanitized doclet summary, in the case of a tutorial or the readme this is the summary value supplied through either the extended configuration or options. +- **description** + This is the HTML sanitized doclet description. +- **body** + This is the full text of the main content section of the generated HTML for the doclet. Any matches against this have the lowest possible weighting. + +### Why Prism instead of Sunlight? + +Quite simply Sunlight is no longer maintained and while it does work I prefer Prism which is actively maintained and follows HTML5 standards. + +## To Do + +- Refactor and document the template source code. Now that I know how it all works I can slim down source code and then heavily document it so I can use it as the example documentation. + +## Changelog + +All releases prior to 1.0.0 are considered pre-release, i.e. I'm not finished changing stuff yet so anything can happen ;) + +### 0.0.9 + +- Fixed issue with the `footer` option not rendering HTML as it was intended. +- Fixed the missing `global.html` issue. +- Updated the `copyright` option to also allow HTML in it's content. +- Updated the `_navbar.hbs` so that if an item has no members it is simply rendered as a link instead of an empty dropdown. +- Updated the base CSS to apply a background color to the `` element that matches the footer. This stops the page looking 'incomplete' or 'broken' as there is no longer any whitespace below the footer. + +### 0.0.8 + +- Updated the navbar dropdowns and the table of contents to handle long lists. If the list exceeds the viewport it now displays a scrollbar. (@mistic100) +- Fixed missing Google Analytics code in the `_layout.hbs`. (@mistic100) +- Added the `favicon` option allowing you to supply a path to an image or icon to use as the favicon for the documentation. (@mistic100) +- Added the `showAccessFilter` option which allows users to filter the symbols of a doclet in real-time by if they are inherited, public, protected or private. + +### 0.0.7 + +- Fixed Prism CSS conflict with `.namespace` class. +- Updated Gruntfile to compile and minify all used prism files (including customized plugins) into single includes. +- Added in the Prism Normalize Whitespace plugin to perform some additional processing to clean up any extra whitespace in examples. + +### 0.0.6 + +- Replaced Sunlight syntax highlighter with Prism as it is maintained and it's just generally better. + +### 0.0.5 + +- Updated TOC to align with crumbs. +- Fixed anchor-links not showing on hover. +- Updated the search input size to match the TOC. + +### 0.0.4 + +- Added missing {@run } javascript and css as well as some additional styling for related tutorials. + +### 0.0.3 + +- Fixed page symbols not generating details correctly when displayed as primary header. + +### 0.0.2 + +- Fixed missing moment.js dependency in the npm package. +- Added .npmignore to exclude the generated examples directory. +- Updated the lunrHelper.js to write files directly to the output directory instead of to the template/static one and then copying it across. + +### 0.0.1 + +- Initial check in of template. diff --git a/__DOCS__/JSDocTemplate/src/conf.json b/__DOCS__/JSDocTemplate/src/conf.json index accbc96..bf9cf94 100644 --- a/__DOCS__/JSDocTemplate/src/conf.json +++ b/__DOCS__/JSDocTemplate/src/conf.json @@ -1,35 +1,35 @@ -{ - "tags": { - "allowUnknownTags": true - }, - "plugins": ["plugins/markdown"], - "templates": { - "includeDate": true, - "dateFormat": "Do MMM YYYY", - "systemName": "FooDoc", - "systemSummary": "A Bootstrap and Handlebars based JSDoc3 template.", - "systemLogo": "", - "systemColor": "", - "copyright": "FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects.", - "linenums": true, - "collapseSymbols": true, - "inverseNav": true, - "inlineNav": false, - "outputSourceFiles": true, - "outputSourcePath": false, - "disablePackagePath": true, - "methodHeadingReturns": true, - "showTableOfContents": true, - "showAccessFilter": false, - "sort": "linenum, longname, version, since", - "search": true, - "analytics": {"ua": null, "domain": null}, - "favicon": null, - "stylesheets": [], - "scripts": [] - }, - "markdown": { - "parser": "gfm", - "hardwrap": true - } -} +{ + "tags": { + "allowUnknownTags": true + }, + "plugins": ["plugins/markdown"], + "templates": { + "includeDate": true, + "dateFormat": "Do MMM YYYY", + "systemName": "FooDoc", + "systemSummary": "A Bootstrap and Handlebars based JSDoc3 template.", + "systemLogo": "", + "systemColor": "", + "copyright": "FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects.", + "linenums": true, + "collapseSymbols": true, + "inverseNav": true, + "inlineNav": false, + "outputSourceFiles": true, + "outputSourcePath": false, + "disablePackagePath": true, + "methodHeadingReturns": true, + "showTableOfContents": true, + "showAccessFilter": false, + "sort": "linenum, longname, version, since", + "search": true, + "analytics": { "ua": null, "domain": null }, + "favicon": null, + "stylesheets": [], + "scripts": [] + }, + "markdown": { + "parser": "gfm", + "hardwrap": true + } +} diff --git a/__DOCS__/JSDocTemplate/src/publish.js b/__DOCS__/JSDocTemplate/src/publish.js index d189830..c3dce0e 100644 --- a/__DOCS__/JSDocTemplate/src/publish.js +++ b/__DOCS__/JSDocTemplate/src/publish.js @@ -1,6 +1,6 @@ -var template = require('./utils/template'); -exports.publish = function(taffyData, opts, tutorials){ - template.configure(taffyData, opts, tutorials); - template.postProcess(); - template.publish(); -}; \ No newline at end of file +var template = require("./utils/template"); +exports.publish = function (taffyData, opts, tutorials) { + template.configure(taffyData, opts, tutorials); + template.postProcess(); + template.publish(); +}; diff --git a/__DOCS__/JSDocTemplate/src/static/css/access-filter.css b/__DOCS__/JSDocTemplate/src/static/css/access-filter.css index 78c8f6a..31efe79 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/access-filter.css +++ b/__DOCS__/JSDocTemplate/src/static/css/access-filter.css @@ -1,39 +1,39 @@ -.access-filter { - text-align: right; - font-size: 12px; - padding: 8px 15px; - margin-top: 0; - margin-bottom: 20px; - list-style: none; - background-color: #f5f5f5; - border-radius: 4px; - color: #767676; -} -.breadcrumb+.access-filter { - margin-top: -25px; - margin-bottom: 0; -} -.access-filter .checkbox-inline input[type=checkbox] { - margin: 1px 0 0 -17px; -} -.access-filter .checkbox-inline, -.access-filter .checkbox-inline:before { - color: #767676; -} -.access-filter .checkbox-inline:hover, -.access-filter .checkbox-inline:focus, -.access-filter .checkbox-inline.checked { - color: #337ab7; -} - -.access-filter .checkbox-inline:before { - display: inline-block; - position: relative; - left: -25px; -} -.access-filter .checkbox-inline:first-of-type:before { - content: "Show -"; -} -.access-filter .checkbox-inline+.checkbox-inline:before { - content: "|"; -} \ No newline at end of file +.access-filter { + text-align: right; + font-size: 12px; + padding: 8px 15px; + margin-top: 0; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; + color: #767676; +} +.breadcrumb + .access-filter { + margin-top: -25px; + margin-bottom: 0; +} +.access-filter .checkbox-inline input[type="checkbox"] { + margin: 1px 0 0 -17px; +} +.access-filter .checkbox-inline, +.access-filter .checkbox-inline:before { + color: #767676; +} +.access-filter .checkbox-inline:hover, +.access-filter .checkbox-inline:focus, +.access-filter .checkbox-inline.checked { + color: #337ab7; +} + +.access-filter .checkbox-inline:before { + display: inline-block; + position: relative; + left: -25px; +} +.access-filter .checkbox-inline:first-of-type:before { + content: "Show -"; +} +.access-filter .checkbox-inline + .checkbox-inline:before { + content: "|"; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/anchor-link.css b/__DOCS__/JSDocTemplate/src/static/css/anchor-link.css index af9d4ae..949ac30 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/anchor-link.css +++ b/__DOCS__/JSDocTemplate/src/static/css/anchor-link.css @@ -1,26 +1,26 @@ -.anchored { - position: relative; -} -.anchor-link { - position: absolute; - left: -55px; - padding-right: 15px; - text-indent: 0; - display: inline-block; - min-width: 60px; - text-align: right; - opacity: 0; - visibility: hidden; - color: #999; -} -.anchor-link:hover { - color: #777; -} -h1:hover .anchor-link, -h2:hover .anchor-link, -h3:hover .anchor-link, -h4:hover .anchor-link, -.expanded .anchor-link { - opacity: 1; - visibility: visible; -} \ No newline at end of file +.anchored { + position: relative; +} +.anchor-link { + position: absolute; + left: -55px; + padding-right: 15px; + text-indent: 0; + display: inline-block; + min-width: 60px; + text-align: right; + opacity: 0; + visibility: hidden; + color: #999; +} +.anchor-link:hover { + color: #777; +} +h1:hover .anchor-link, +h2:hover .anchor-link, +h3:hover .anchor-link, +h4:hover .anchor-link, +.expanded .anchor-link { + opacity: 1; + visibility: visible; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/breadcrumbs.css b/__DOCS__/JSDocTemplate/src/static/css/breadcrumbs.css index e205eae..04b84bb 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/breadcrumbs.css +++ b/__DOCS__/JSDocTemplate/src/static/css/breadcrumbs.css @@ -1,3 +1,3 @@ -.breadcrumb li a { - color: #337ab7; -} \ No newline at end of file +.breadcrumb li a { + color: #337ab7; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/callout.css b/__DOCS__/JSDocTemplate/src/static/css/callout.css index 0fbba19..9c29eff 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/callout.css +++ b/__DOCS__/JSDocTemplate/src/static/css/callout.css @@ -1,99 +1,99 @@ -/* - * Callouts - * - * Not quite alerts, but custom and helpful notes for folks reading the docs. - * Requires a base and modifier class. - */ -.callout { - padding: 20px; - margin: 20px 0; - border: 1px solid #eee; - border-left-width: 5px; - border-radius: 3px; -} -.callout h5 { - margin-top: 0; - margin-bottom: 5px; - /* text-transform: uppercase; */ - /* letter-spacing: 1px; */ - font-family: inherit; - font-weight: 500; - line-height: 1.1; - font-size: 18px; -} -.callout p:last-child, -.callout table:last-child { - margin-bottom: 0; -} -.callout code { - border-radius: 3px; -} -.callout .control-label { - color: #999; - font-weight: normal; -} -.callout+.callout { - margin-top: -5px; -} - -.callout-default { - border-left-color: #999; -} -.callout-default h5 { - color: #999; -} -.callout-primary { - border-left-color: #337ab7; -} -.callout-primary h5 { - color: #337ab7; -} -.callout-success { - border-left-color: #5cb85c; -} -.callout-success h5 { - color: #5cb85c; -} -.callout-danger { - border-left-color: #d9534f; -} -.callout-danger h5 { - color: #d9534f; -} -.callout-warning { - border-left-color: #f0ad4e; -} -.callout-warning h5 { - color: #f0ad4e; -} -.callout-info { - border-left-color: #87b9f1; -} -.callout-info h5 { - color: #87b9f1; -} -.callout-rpc { - border-left-color: #c7bfd3; -} -.callout-rpc h5 { - color: #c7bfd3; -} -.callout-example { - border-left-color: #8461b9; -} -.callout-example h5 { - color: #8461b9; -} - -.callout .form-group { - margin-bottom: 5px; -} -.callout .form-group > div.control-static > p { - min-height: 34px; - padding-top: 7px; - padding-bottom: 7px; - margin-bottom: 0; -} -.callout .table > thead > tr > th { - font-weight: normal; -} \ No newline at end of file +/* + * Callouts + * + * Not quite alerts, but custom and helpful notes for folks reading the docs. + * Requires a base and modifier class. + */ +.callout { + padding: 20px; + margin: 20px 0; + border: 1px solid #eee; + border-left-width: 5px; + border-radius: 3px; +} +.callout h5 { + margin-top: 0; + margin-bottom: 5px; + /* text-transform: uppercase; */ + /* letter-spacing: 1px; */ + font-family: inherit; + font-weight: 500; + line-height: 1.1; + font-size: 18px; +} +.callout p:last-child, +.callout table:last-child { + margin-bottom: 0; +} +.callout code { + border-radius: 3px; +} +.callout .control-label { + color: #999; + font-weight: normal; +} +.callout + .callout { + margin-top: -5px; +} + +.callout-default { + border-left-color: #999; +} +.callout-default h5 { + color: #999; +} +.callout-primary { + border-left-color: #337ab7; +} +.callout-primary h5 { + color: #337ab7; +} +.callout-success { + border-left-color: #5cb85c; +} +.callout-success h5 { + color: #5cb85c; +} +.callout-danger { + border-left-color: #d9534f; +} +.callout-danger h5 { + color: #d9534f; +} +.callout-warning { + border-left-color: #f0ad4e; +} +.callout-warning h5 { + color: #f0ad4e; +} +.callout-info { + border-left-color: #87b9f1; +} +.callout-info h5 { + color: #87b9f1; +} +.callout-rpc { + border-left-color: #c7bfd3; +} +.callout-rpc h5 { + color: #c7bfd3; +} +.callout-example { + border-left-color: #8461b9; +} +.callout-example h5 { + color: #8461b9; +} + +.callout .form-group { + margin-bottom: 5px; +} +.callout .form-group > div.control-static > p { + min-height: 34px; + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.callout .table > thead > tr > th { + font-weight: normal; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/dummy-console.css b/__DOCS__/JSDocTemplate/src/static/css/dummy-console.css index 4478413..11ff9a5 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/dummy-console.css +++ b/__DOCS__/JSDocTemplate/src/static/css/dummy-console.css @@ -1,6 +1,6 @@ -.dummy-console { - font-family: Menlo,Monaco,Consolas,"Courier New",monospace; - font-size: 12px; - resize: vertical; - margin-bottom: 15px; -} \ No newline at end of file +.dummy-console { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 12px; + resize: vertical; + margin-bottom: 15px; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/lunr-search.css b/__DOCS__/JSDocTemplate/src/static/css/lunr-search.css index e3fd943..ff7939e 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/lunr-search.css +++ b/__DOCS__/JSDocTemplate/src/static/css/lunr-search.css @@ -1,58 +1,58 @@ -#lunr-search-footer .pagination { - margin: 0; -} - -.lunr-search-results-page { - list-style: none; - padding: 0; - display: none; -} -.lunr-search-results-page.active { - display: block; -} -.lunr-search-results-page li { - list-style: none; - margin-bottom: 20px; -} - -span.lunr-search-result-kind { - text-transform: capitalize; -} -a.lunr-search-result-title { - font-size: 14px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -a.lunr-search-result-title:hover { - text-decoration: underline; -} -p.lunr-search-result-url { - color: #006621; - font-size: 13px; - line-height: 16px; - margin: 0; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -p.lunr-search-result-summary { - color: #999; - font-size: 13px; - line-height: 16px; - margin: 0; - overflow: hidden; - max-height: 48px; - text-overflow: ellipsis; -} - -@media (min-width: 992px) { - .navbar-form { - width: 228px;/* 3 col */ - } -} -@media (min-width: 1200px) { - .navbar-form { - width: 278px;/* 3 col*/ - } -} \ No newline at end of file +#lunr-search-footer .pagination { + margin: 0; +} + +.lunr-search-results-page { + list-style: none; + padding: 0; + display: none; +} +.lunr-search-results-page.active { + display: block; +} +.lunr-search-results-page li { + list-style: none; + margin-bottom: 20px; +} + +span.lunr-search-result-kind { + text-transform: capitalize; +} +a.lunr-search-result-title { + font-size: 14px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +a.lunr-search-result-title:hover { + text-decoration: underline; +} +p.lunr-search-result-url { + color: #006621; + font-size: 13px; + line-height: 16px; + margin: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +p.lunr-search-result-summary { + color: #999; + font-size: 13px; + line-height: 16px; + margin: 0; + overflow: hidden; + max-height: 48px; + text-overflow: ellipsis; +} + +@media (min-width: 992px) { + .navbar-form { + width: 228px; /* 3 col */ + } +} +@media (min-width: 1200px) { + .navbar-form { + width: 278px; /* 3 col*/ + } +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/page-header.css b/__DOCS__/JSDocTemplate/src/static/css/page-header.css index 2d13f9f..4da9a10 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/page-header.css +++ b/__DOCS__/JSDocTemplate/src/static/css/page-header.css @@ -1,79 +1,79 @@ -/* - * Page headers - * - * Jumbotron-esque headers at the top of every page. - */ -.page-header { - margin-top: 0; - margin-bottom: 40px; - padding: 15px 0; - background-color: #337ab7; -} -.page-header .kind { - font-size: 50px; - line-height: 1.1; - text-transform: uppercase; - opacity: .1; - position: absolute; - right: 15px; - color: #fff; -} -.page-header h1 { - font-size: 36px; - line-height: 1.1; - margin-top: 0; - color: #fff; -} -.page-header .ancestors { - display: block; - font-size: 16px; -} -.page-header .ancestors a { - color: #FFF; - opacity: 0.3; -} -.page-header .ancestors a:hover { - opacity: 1; - text-decoration: underline; -} -.page-header .ancestors+.name { - margin-left: 15px; -} -.page-header p { - font-size: 20px; - margin-bottom: 0; - font-weight: 300; - line-height: 1.4; - color: #d0d0d0; -} -.page-header .container { - position: relative; -} - -#topNavigation .dropdown-menu { - max-height: 640px; - max-height: calc(100vh - 62px); - overflow-y: auto; -} - -@media (min-width: 768px) { - .page-header { - padding-top: 60px; - padding-bottom: 60px; - text-align: left; - } - .page-header .kind { - font-size: 80px; - line-height: 1; - } - .page-header h1 { - font-size: 60px; - line-height: 1; - } - .page-header .ancestors { - font-size: 20px; - } - .page-header p { - font-size: 24px; - } -} +/* + * Page headers + * + * Jumbotron-esque headers at the top of every page. + */ +.page-header { + margin-top: 0; + margin-bottom: 40px; + padding: 15px 0; + background-color: #337ab7; +} +.page-header .kind { + font-size: 50px; + line-height: 1.1; + text-transform: uppercase; + opacity: 0.1; + position: absolute; + right: 15px; + color: #fff; +} +.page-header h1 { + font-size: 36px; + line-height: 1.1; + margin-top: 0; + color: #fff; +} +.page-header .ancestors { + display: block; + font-size: 16px; +} +.page-header .ancestors a { + color: #fff; + opacity: 0.3; +} +.page-header .ancestors a:hover { + opacity: 1; + text-decoration: underline; +} +.page-header .ancestors + .name { + margin-left: 15px; +} +.page-header p { + font-size: 20px; + margin-bottom: 0; + font-weight: 300; + line-height: 1.4; + color: #d0d0d0; +} +.page-header .container { + position: relative; +} + +#topNavigation .dropdown-menu { + max-height: 640px; + max-height: calc(100vh - 62px); + overflow-y: auto; +} + +@media (min-width: 768px) { + .page-header { + padding-top: 60px; + padding-bottom: 60px; + text-align: left; + } + .page-header .kind { + font-size: 80px; + line-height: 1; + } + .page-header h1 { + font-size: 60px; + line-height: 1; + } + .page-header .ancestors { + font-size: 20px; + } + .page-header p { + font-size: 24px; + } +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/prism-line-numbers.css b/__DOCS__/JSDocTemplate/src/static/css/prism-line-numbers.css index f3cfd1e..d6dba80 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/prism-line-numbers.css +++ b/__DOCS__/JSDocTemplate/src/static/css/prism-line-numbers.css @@ -1,41 +1,40 @@ pre.line-numbers { - position: relative; - padding-left: 4.8em; - counter-reset: linenumber; + position: relative; + padding-left: 4.8em; + counter-reset: linenumber; } pre.line-numbers > code { - position: relative; + position: relative; } .line-numbers .line-numbers-rows { - position: absolute; - top: 0; - font-size: 100%; - left: -4.8em; - width: 4em; /* works for 4 digit line-numbers */ - letter-spacing: -1px; - border-right: 1px solid #e1e1e8; - - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + position: absolute; + top: 0; + font-size: 100%; + left: -4.8em; + width: 4em; /* works for 4 digit line-numbers */ + letter-spacing: -1px; + border-right: 1px solid #e1e1e8; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } - .line-numbers-rows > a { - display: block; - counter-increment: linenumber; - color: #bdbdbd; - } - .line-numbers-rows > a:hover { - color: #9b9b9b; - } +.line-numbers-rows > a { + display: block; + counter-increment: linenumber; + color: #bdbdbd; +} +.line-numbers-rows > a:hover { + color: #9b9b9b; +} - .line-numbers-rows > a:before { - content: counter(linenumber); - display: block; - padding-right: 0.8em; - text-align: right; - } \ No newline at end of file +.line-numbers-rows > a:before { + content: counter(linenumber); + display: block; + padding-right: 0.8em; + text-align: right; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/prism-theme-overrides.css b/__DOCS__/JSDocTemplate/src/static/css/prism-theme-overrides.css index 6be6b1d..cdd2472 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/prism-theme-overrides.css +++ b/__DOCS__/JSDocTemplate/src/static/css/prism-theme-overrides.css @@ -1,52 +1,75 @@ -/* Override default Bootstrap border for PRE */ -pre { - border: 1px solid #e1e1e8; -} - -/* Override prism default theme and make it look like Chromes debugger which everyone should recognise */ -:not(pre) > code[class*="language-"], pre[class*="language-"] { - background-color: #f7f7f9; -} -code[class*="language-"], pre[class*="language-"] { - text-shadow: none; - color: #333; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -.namespace { - opacity: 1; -} -.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { - background: none; -} -.token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { - color: #270dd1; -} -.token.atrule, .token.attr-value { - color: #270dd1; -} -.token.tag, .token.keyword { - color: #aa0d91; -} -.token.property, .token.string, .token.char, .token.builtin, .token.inserted { - color: #c41a16; -} -.token.url, .language-css .token.string { - color: #40a9b1; -} -.token.attr-name { - color: #994500; -} -.token.prolog, .token.doctype, .token.cdata { - color: #999; -} -.token.comment { - color: #007400; -} -.language-html .token.punctuation, .language-markup .token.punctuation { - color: #b2a1b0; -} -.token.selector, .token.function, .token.punctuation, .token.operator { - color: #333; -} \ No newline at end of file +/* Override default Bootstrap border for PRE */ +pre { + border: 1px solid #e1e1e8; +} + +/* Override prism default theme and make it look like Chromes debugger which everyone should recognise */ +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background-color: #f7f7f9; +} +code[class*="language-"], +pre[class*="language-"] { + text-shadow: none; + color: #333; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +.namespace { + opacity: 1; +} +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + background: none; +} +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #270dd1; +} +.token.atrule, +.token.attr-value { + color: #270dd1; +} +.token.tag, +.token.keyword { + color: #aa0d91; +} +.token.property, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #c41a16; +} +.token.url, +.language-css .token.string { + color: #40a9b1; +} +.token.attr-name { + color: #994500; +} +.token.prolog, +.token.doctype, +.token.cdata { + color: #999; +} +.token.comment { + color: #007400; +} +.language-html .token.punctuation, +.language-markup .token.punctuation { + color: #b2a1b0; +} +.token.selector, +.token.function, +.token.punctuation, +.token.operator { + color: #333; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/prism-toolbar.css b/__DOCS__/JSDocTemplate/src/static/css/prism-toolbar.css index 9a19cc8..d5f153b 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/prism-toolbar.css +++ b/__DOCS__/JSDocTemplate/src/static/css/prism-toolbar.css @@ -1,65 +1,65 @@ -pre.code-toolbar { - position: relative; -} - -pre.code-toolbar > .toolbar { - position: absolute; - top: 0; - right: 0; - z-index: 10; - display: block; - padding: 0; - font-size: 12px; - color: #767676; - cursor: pointer; - background-color: #fff; - border-left: 1px solid #e1e1e8; - border-bottom: 1px solid #e1e1e8; - border-radius: 0 4px 0 4px; -} - -pre.code-toolbar > .toolbar:hover { - color: #fff; - background-color: #337ab7; - border-left-color: #337ab7; - border-bottom-color: #337ab7; -} - -pre.code-toolbar > .toolbar .toolbar-item { - display: inline-block; -} - -pre.code-toolbar > .toolbar a { - cursor: pointer; -} - -pre.code-toolbar > .toolbar button { - background: none; - border: 0; - color: inherit; - font: inherit; - line-height: normal; - overflow: visible; - padding: 0; - -webkit-user-select: none; /* for button */ - -moz-user-select: none; - -ms-user-select: none; -} - -pre.code-toolbar > .toolbar a, -pre.code-toolbar > .toolbar button, -pre.code-toolbar > .toolbar span { - color: inherit; - padding: 5px 8px; - display: inline-block; -} - -pre.code-toolbar > .toolbar a:hover, -pre.code-toolbar > .toolbar a:focus, -pre.code-toolbar > .toolbar button:hover, -pre.code-toolbar > .toolbar button:focus, -pre.code-toolbar > .toolbar span:hover, -pre.code-toolbar > .toolbar span:focus { - color: inherit; - text-decoration: none; -} \ No newline at end of file +pre.code-toolbar { + position: relative; +} + +pre.code-toolbar > .toolbar { + position: absolute; + top: 0; + right: 0; + z-index: 10; + display: block; + padding: 0; + font-size: 12px; + color: #767676; + cursor: pointer; + background-color: #fff; + border-left: 1px solid #e1e1e8; + border-bottom: 1px solid #e1e1e8; + border-radius: 0 4px 0 4px; +} + +pre.code-toolbar > .toolbar:hover { + color: #fff; + background-color: #337ab7; + border-left-color: #337ab7; + border-bottom-color: #337ab7; +} + +pre.code-toolbar > .toolbar .toolbar-item { + display: inline-block; +} + +pre.code-toolbar > .toolbar a { + cursor: pointer; +} + +pre.code-toolbar > .toolbar button { + background: none; + border: 0; + color: inherit; + font: inherit; + line-height: normal; + overflow: visible; + padding: 0; + -webkit-user-select: none; /* for button */ + -moz-user-select: none; + -ms-user-select: none; +} + +pre.code-toolbar > .toolbar a, +pre.code-toolbar > .toolbar button, +pre.code-toolbar > .toolbar span { + color: inherit; + padding: 5px 8px; + display: inline-block; +} + +pre.code-toolbar > .toolbar a:hover, +pre.code-toolbar > .toolbar a:focus, +pre.code-toolbar > .toolbar button:hover, +pre.code-toolbar > .toolbar button:focus, +pre.code-toolbar > .toolbar span:hover, +pre.code-toolbar > .toolbar span:focus { + color: inherit; + text-decoration: none; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/related-tutorials.css b/__DOCS__/JSDocTemplate/src/static/css/related-tutorials.css index e91c631..6972650 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/related-tutorials.css +++ b/__DOCS__/JSDocTemplate/src/static/css/related-tutorials.css @@ -1,9 +1,9 @@ -/* Related tutorials */ -.related-tutorials ul { - margin-top: 20px; -} -.related-tutorials ul li a { - font-size: 16px; - margin: 5px 0; - display: inline-block; -} \ No newline at end of file +/* Related tutorials */ +.related-tutorials ul { + margin-top: 20px; +} +.related-tutorials ul li a { + font-size: 16px; + margin: 5px 0; + display: inline-block; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/site.css b/__DOCS__/JSDocTemplate/src/static/css/site.css index 5105c59..4aa2de7 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/site.css +++ b/__DOCS__/JSDocTemplate/src/static/css/site.css @@ -1,40 +1,40 @@ -html { - margin-top: 50px; - background-color: #f9f9f9; -} -.navbar-brand.branding-logo { - background-position: 15px center; - background-size: 40px; - background-repeat: no-repeat; - text-indent: 44px; -} -.main-content { - padding-bottom: 200px; -} -.main-content h1, -.main-content h2 { - border-bottom: 1px solid #eee; - margin-top: 20px; - margin-bottom: 20px; - padding-bottom: 9px; -} -.main-content .primary p+h1, -.main-content .primary p+h2, -.main-content .readme-section p+h1, -.main-content .readme-section p+h2, -.main-content .tutorial-section p+h1, -.main-content .tutorial-section p+h2, -.main-content .related-tutorials h2 { - margin-top: 40px; -} -footer { - width: 100%; - max-width: 100%; - overflow: hidden; - padding: 15px; - text-align: center; - background-color: #f9f9f9; - border-top: solid 1px #ddd; - font-size: small; - color: #777; -} \ No newline at end of file +html { + margin-top: 50px; + background-color: #f9f9f9; +} +.navbar-brand.branding-logo { + background-position: 15px center; + background-size: 40px; + background-repeat: no-repeat; + text-indent: 44px; +} +.main-content { + padding-bottom: 200px; +} +.main-content h1, +.main-content h2 { + border-bottom: 1px solid #eee; + margin-top: 20px; + margin-bottom: 20px; + padding-bottom: 9px; +} +.main-content .primary p + h1, +.main-content .primary p + h2, +.main-content .readme-section p + h1, +.main-content .readme-section p + h2, +.main-content .tutorial-section p + h1, +.main-content .tutorial-section p + h2, +.main-content .related-tutorials h2 { + margin-top: 40px; +} +footer { + width: 100%; + max-width: 100%; + overflow: hidden; + padding: 15px; + text-align: center; + background-color: #f9f9f9; + border-top: solid 1px #ddd; + font-size: small; + color: #777; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/symbols.css b/__DOCS__/JSDocTemplate/src/static/css/symbols.css index b3050b3..a095eb4 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/symbols.css +++ b/__DOCS__/JSDocTemplate/src/static/css/symbols.css @@ -1,50 +1,50 @@ -dl.symbol { -} -dl.symbol dl.symbol { - margin-left: 15px; - margin-bottom: 15px; -} -.symbol-title h1, -.symbol-title h2, -.symbol-title h3, -.symbol-title h4, -.symbol-title h5 { - font-family: Menlo,Monaco,Consolas,"Courier New",monospace; - padding-left: 50px; - text-indent: -50px; -} -.main-content .symbol-title h1, -.main-content .symbol-title h2 { - border-bottom: none; - margin-bottom: inherit; -} - -.symbol-title .name-signature, -.symbol-title .signature-params { - color: #222; -} -.symbol-title h4.event, -.symbol-title .name-string, -.symbol-title .signature-param { - color: #c7254e; -} -.symbol-details { - overflow: hidden; -} - -.symbol-title.collapsible-symbol { - cursor: pointer; -} -.symbol-title.collapsible-symbol .toggle-icon { - color: #337ab7; - text-indent: 0; -} -.symbol-title.collapsible-symbol:hover .toggle-icon { - opacity: 0.8; -} -.symbol-details.collapsible-symbol { - max-height: 0; -} -.symbol-details.collapsible-symbol.transition { - transition: max-height .4s ease-in; -} \ No newline at end of file +dl.symbol { +} +dl.symbol dl.symbol { + margin-left: 15px; + margin-bottom: 15px; +} +.symbol-title h1, +.symbol-title h2, +.symbol-title h3, +.symbol-title h4, +.symbol-title h5 { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding-left: 50px; + text-indent: -50px; +} +.main-content .symbol-title h1, +.main-content .symbol-title h2 { + border-bottom: none; + margin-bottom: inherit; +} + +.symbol-title .name-signature, +.symbol-title .signature-params { + color: #222; +} +.symbol-title h4.event, +.symbol-title .name-string, +.symbol-title .signature-param { + color: #c7254e; +} +.symbol-details { + overflow: hidden; +} + +.symbol-title.collapsible-symbol { + cursor: pointer; +} +.symbol-title.collapsible-symbol .toggle-icon { + color: #337ab7; + text-indent: 0; +} +.symbol-title.collapsible-symbol:hover .toggle-icon { + opacity: 0.8; +} +.symbol-details.collapsible-symbol { + max-height: 0; +} +.symbol-details.collapsible-symbol.transition { + transition: max-height 0.4s ease-in; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/tags.css b/__DOCS__/JSDocTemplate/src/static/css/tags.css index 298102d..7c463ec 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/tags.css +++ b/__DOCS__/JSDocTemplate/src/static/css/tags.css @@ -1,12 +1,12 @@ -.summary { - font-size: 15px; - font-weight: normal; - color: #808080; -} - -.signature-type, -.signature-attribs, -.signature-new { - color: #adadad; - font-size: smaller; -} \ No newline at end of file +.summary { + font-size: 15px; + font-weight: normal; + color: #808080; +} + +.signature-type, +.signature-attribs, +.signature-new { + color: #adadad; + font-size: smaller; +} diff --git a/__DOCS__/JSDocTemplate/src/static/css/toc.css b/__DOCS__/JSDocTemplate/src/static/css/toc.css index fdfbb61..54d6c50 100644 --- a/__DOCS__/JSDocTemplate/src/static/css/toc.css +++ b/__DOCS__/JSDocTemplate/src/static/css/toc.css @@ -1,161 +1,161 @@ -/* Side Menu */ - -/* By default it's not affixed in mobile views, so undo that */ -.toc.affix { - position: static; -} - -/* First level of nav */ -.toc-nav { - margin-top: 5px; - padding-bottom: 10px; - max-height: 95%; - max-height: calc(100% - 2em); - overflow-y: auto; -} - -/* All levels of nav */ -.toc .nav > li > a { - display: block; - padding: 4px 4px 4px 36px; - text-indent: -20px; - font-size: 14px; - font-weight: 500; - color: #767676; -} -.toc .nav > li > a:hover, -.toc .nav > li > a:focus { - padding-left: 35px; - color: #337ab7; - text-decoration: none; - background-color: transparent; - border-left: 1px solid #337ab7; -} -.toc .nav > li.active > a, -.toc .nav > li.active > a:hover, -.toc .nav > li.active > a:focus { - padding-left: 34px; - color: #337ab7; - background-color: transparent; - border-left: 2px solid #337ab7; -} - -.toc .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} -.toc .nav .nav > li > a { - font-size: 13px; - padding-left: 39px; - font-weight: normal; -} -.toc .nav .nav > li > a:hover, -.toc .nav .nav > li > a:focus { - padding-left: 38px; -} -.toc .nav .nav > li.active > a, -.toc .nav .nav > li.active > a:hover, -.toc .nav .nav > li.active > a:focus { - padding-left: 37px; -} - -.toc .nav .nav .nav > li > a { - font-size: 12px; - padding-left: 44px; -} -.toc .nav .nav .nav > li > a:hover, -.toc .nav .nav .nav > li > a:focus { - padding-left: 43px; -} -.toc .nav .nav .nav > li.active > a, -.toc .nav .nav .nav > li.active > a:hover, -.toc .nav .nav .nav > li.active > a:focus { - padding-left: 42px; -} - -.toc .nav .nav .nav .nav > li > a { - font-size: 12px; - padding-left: 49px; -} -.toc .nav .nav .nav .nav > li > a:hover, -.toc .nav .nav .nav .nav > li > a:focus { - padding-left: 48px; -} -.toc .nav .nav .nav .nav > li.active > a, -.toc .nav .nav .nav .nav > li.active > a:hover, -.toc .nav .nav .nav .nav > li.active > a:focus { - padding-left: 47px; -} -.toc .nav > li > a .name-require { - color: #767676; -} -.toc .nav > li > a > .ancestors > span { - color: #337ab7; -} -.toc .nav > li > a .signature-attribs { - font-weight: normal; -} -.toc .nav > li > a .name-signature, -.toc .nav > li > a .signature-params { - color: #000; -} -.toc .nav > li.event > a .name, -.toc .nav > li > a .name-string, -.toc .nav > li > a .signature-param { - color: #c7254e; -} -/* Back to top (hidden on mobile) */ -.back-to-top { - display: none; - padding: 4px 10px; - margin-top: 10px; - margin-left: 10px; - font-size: 12px; - font-weight: 500; - color: #999; - cursor: pointer; -} -.back-to-top:hover { - color: #337ab7; - text-decoration: none; -} - -@media (min-width: 768px) { - .back-to-top { - display: block; - } -} - -/* Show and affix the side nav when space allows it */ -@media (min-width: 992px) { - .toc .nav > .active > ul { - display: block; - } - /* Widen the fixed sidebar */ - .toc.affix, - .toc.affix-bottom { - width: 213px;/* 3 col */ - /*width: 293px;/* 4 col */ - } - .toc.affix { - position: fixed; /* Undo the static from mobile first approach */ - top: 67px; - height: calc(100% - 67px - 50px); - } - .toc.affix-bottom { - position: absolute; /* Undo the static from mobile first approach */ - } - .toc.affix-bottom .toc-nav, - .toc.affix .toc-nav { - margin-top: 0; - margin-bottom: 0; - } -} -@media (min-width: 1200px) { - /* Widen the fixed sidebar again */ - .toc.affix-bottom, - .toc.affix { - width: 263px;/* 3 col*/ - /*width: 360px;/* 4 col */ - } -} +/* Side Menu */ + +/* By default it's not affixed in mobile views, so undo that */ +.toc.affix { + position: static; +} + +/* First level of nav */ +.toc-nav { + margin-top: 5px; + padding-bottom: 10px; + max-height: 95%; + max-height: calc(100% - 2em); + overflow-y: auto; +} + +/* All levels of nav */ +.toc .nav > li > a { + display: block; + padding: 4px 4px 4px 36px; + text-indent: -20px; + font-size: 14px; + font-weight: 500; + color: #767676; +} +.toc .nav > li > a:hover, +.toc .nav > li > a:focus { + padding-left: 35px; + color: #337ab7; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #337ab7; +} +.toc .nav > li.active > a, +.toc .nav > li.active > a:hover, +.toc .nav > li.active > a:focus { + padding-left: 34px; + color: #337ab7; + background-color: transparent; + border-left: 2px solid #337ab7; +} + +.toc .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +.toc .nav .nav > li > a { + font-size: 13px; + padding-left: 39px; + font-weight: normal; +} +.toc .nav .nav > li > a:hover, +.toc .nav .nav > li > a:focus { + padding-left: 38px; +} +.toc .nav .nav > li.active > a, +.toc .nav .nav > li.active > a:hover, +.toc .nav .nav > li.active > a:focus { + padding-left: 37px; +} + +.toc .nav .nav .nav > li > a { + font-size: 12px; + padding-left: 44px; +} +.toc .nav .nav .nav > li > a:hover, +.toc .nav .nav .nav > li > a:focus { + padding-left: 43px; +} +.toc .nav .nav .nav > li.active > a, +.toc .nav .nav .nav > li.active > a:hover, +.toc .nav .nav .nav > li.active > a:focus { + padding-left: 42px; +} + +.toc .nav .nav .nav .nav > li > a { + font-size: 12px; + padding-left: 49px; +} +.toc .nav .nav .nav .nav > li > a:hover, +.toc .nav .nav .nav .nav > li > a:focus { + padding-left: 48px; +} +.toc .nav .nav .nav .nav > li.active > a, +.toc .nav .nav .nav .nav > li.active > a:hover, +.toc .nav .nav .nav .nav > li.active > a:focus { + padding-left: 47px; +} +.toc .nav > li > a .name-require { + color: #767676; +} +.toc .nav > li > a > .ancestors > span { + color: #337ab7; +} +.toc .nav > li > a .signature-attribs { + font-weight: normal; +} +.toc .nav > li > a .name-signature, +.toc .nav > li > a .signature-params { + color: #000; +} +.toc .nav > li.event > a .name, +.toc .nav > li > a .name-string, +.toc .nav > li > a .signature-param { + color: #c7254e; +} +/* Back to top (hidden on mobile) */ +.back-to-top { + display: none; + padding: 4px 10px; + margin-top: 10px; + margin-left: 10px; + font-size: 12px; + font-weight: 500; + color: #999; + cursor: pointer; +} +.back-to-top:hover { + color: #337ab7; + text-decoration: none; +} + +@media (min-width: 768px) { + .back-to-top { + display: block; + } +} + +/* Show and affix the side nav when space allows it */ +@media (min-width: 992px) { + .toc .nav > .active > ul { + display: block; + } + /* Widen the fixed sidebar */ + .toc.affix, + .toc.affix-bottom { + width: 213px; /* 3 col */ + /*width: 293px;/* 4 col */ + } + .toc.affix { + position: fixed; /* Undo the static from mobile first approach */ + top: 67px; + height: calc(100% - 67px - 50px); + } + .toc.affix-bottom { + position: absolute; /* Undo the static from mobile first approach */ + } + .toc.affix-bottom .toc-nav, + .toc.affix .toc-nav { + margin-top: 0; + margin-bottom: 0; + } +} +@media (min-width: 1200px) { + /* Widen the fixed sidebar again */ + .toc.affix-bottom, + .toc.affix { + width: 263px; /* 3 col*/ + /*width: 360px;/* 4 col */ + } +} diff --git a/__DOCS__/JSDocTemplate/src/static/js/access-filter.js b/__DOCS__/JSDocTemplate/src/static/js/access-filter.js index 6e91cf2..c8ff679 100644 --- a/__DOCS__/JSDocTemplate/src/static/js/access-filter.js +++ b/__DOCS__/JSDocTemplate/src/static/js/access-filter.js @@ -1,108 +1,112 @@ -(function(options, enabled, $){ - - function AccessFilter(){ - if (!(this instanceof AccessFilter)) return new AccessFilter(); - this.$toggleInherited = $(); - this.$togglePublic = $(); - this.$toggleProtected = $(); - this.$togglePrivate = $(); - this.inherited = false; - this.public = false; - this.protected = false; - this.private = false; - } - - $.extend(AccessFilter.prototype, { - init: function(){ - var self = this; - self.$toggleInherited = $(".access-filter .toggle-inherited").on('change', {self: self}, self.onInheritedChanged); - self.setInherited(); - self.$togglePublic = $(".access-filter .toggle-public").on('change', {self: self}, self.onPublicChanged); - self.setPublic(); - self.$toggleProtected = $(".access-filter .toggle-protected").on('change', {self: self}, self.onProtectedChanged); - self.setProtected(); - self.$togglePrivate = $(".access-filter .toggle-private").on('change', {self: self}, self.onPrivateChanged); - self.setPrivate(); - }, - setInherited: function(){ - var self = this; - if (self.$toggleInherited.length > 0){ - self.inherited = self.$toggleInherited.prop("checked"); - var $elem = $(".symbol-title.inherited,.symbol-details.inherited,li.inherited"); - if (self.inherited && !self.public){ - $elem = $elem.not('.public'); - } - if (self.inherited && !self.protected){ - $elem = $elem.not('.protected'); - } - if (self.inherited && !self.private){ - $elem = $elem.not('.private'); - } - $elem = $elem.add($elem.filter(".symbol-title").prev("hr")); - $elem.toggle(self.inherited); - self.$toggleInherited.closest(".checkbox-inline").toggleClass("checked", self.inherited); - } - }, - setPublic: function(){ - var self = this; - if (self.$togglePublic.length > 0){ - self.public = self.$togglePublic.prop("checked"); - var $elem = $(".symbol-title.public,.symbol-details.public,li.public"); - if (!self.inherited){ - $elem = $elem.not('.inherited'); - } - $elem = $elem.add($elem.filter(".symbol-title").prev("hr")); - $elem.toggle(self.public); - self.$togglePublic.closest(".checkbox-inline").toggleClass("checked", self.public); - } - }, - setProtected: function(){ - var self = this; - if (self.$toggleProtected.length > 0){ - self.protected = self.$toggleProtected.prop("checked"); - var $elem = $(".symbol-title.protected,.symbol-details.protected,li.protected"); - if (!self.inherited){ - $elem = $elem.not('.inherited'); - } - $elem = $elem.add($elem.filter(".symbol-title").prev("hr")); - $elem.toggle(self.protected); - self.$toggleProtected.closest(".checkbox-inline").toggleClass("checked", self.protected); - } - }, - setPrivate: function(){ - var self = this; - if (self.$togglePrivate.length > 0){ - self.private = self.$togglePrivate.prop("checked"); - var $elem = $(".symbol-title.private,.symbol-details.private,li.private"); - if (!self.inherited){ - $elem = $elem.not('.inherited'); - } - $elem = $elem.add($elem.filter(".symbol-title").prev("hr")); - $elem.toggle(self.private); - self.$togglePrivate.closest(".checkbox-inline").toggleClass("checked", self.private); - } - }, - onInheritedChanged: function(e){ - e.data.self.setInherited(); - }, - onPublicChanged: function(e){ - e.data.self.setPublic(); - }, - onProtectedChanged: function(e){ - e.data.self.setProtected(); - }, - onPrivateChanged: function(e){ - e.data.self.setPrivate(); - } - }); - - $(function(){ - - if (enabled){ - var filter = new AccessFilter(); - filter.init(); - } - - }); - -})(window.TEMPLATE_OPTIONS, window.DOCLET_AFILTER_ENABLED, jQuery); \ No newline at end of file +(function (options, enabled, $) { + function AccessFilter() { + if (!(this instanceof AccessFilter)) return new AccessFilter(); + this.$toggleInherited = $(); + this.$togglePublic = $(); + this.$toggleProtected = $(); + this.$togglePrivate = $(); + this.inherited = false; + this.public = false; + this.protected = false; + this.private = false; + } + + $.extend(AccessFilter.prototype, { + init: function () { + var self = this; + self.$toggleInherited = $(".access-filter .toggle-inherited").on( + "change", + { self: self }, + self.onInheritedChanged + ); + self.setInherited(); + self.$togglePublic = $(".access-filter .toggle-public").on("change", { self: self }, self.onPublicChanged); + self.setPublic(); + self.$toggleProtected = $(".access-filter .toggle-protected").on( + "change", + { self: self }, + self.onProtectedChanged + ); + self.setProtected(); + self.$togglePrivate = $(".access-filter .toggle-private").on("change", { self: self }, self.onPrivateChanged); + self.setPrivate(); + }, + setInherited: function () { + var self = this; + if (self.$toggleInherited.length > 0) { + self.inherited = self.$toggleInherited.prop("checked"); + var $elem = $(".symbol-title.inherited,.symbol-details.inherited,li.inherited"); + if (self.inherited && !self.public) { + $elem = $elem.not(".public"); + } + if (self.inherited && !self.protected) { + $elem = $elem.not(".protected"); + } + if (self.inherited && !self.private) { + $elem = $elem.not(".private"); + } + $elem = $elem.add($elem.filter(".symbol-title").prev("hr")); + $elem.toggle(self.inherited); + self.$toggleInherited.closest(".checkbox-inline").toggleClass("checked", self.inherited); + } + }, + setPublic: function () { + var self = this; + if (self.$togglePublic.length > 0) { + self.public = self.$togglePublic.prop("checked"); + var $elem = $(".symbol-title.public,.symbol-details.public,li.public"); + if (!self.inherited) { + $elem = $elem.not(".inherited"); + } + $elem = $elem.add($elem.filter(".symbol-title").prev("hr")); + $elem.toggle(self.public); + self.$togglePublic.closest(".checkbox-inline").toggleClass("checked", self.public); + } + }, + setProtected: function () { + var self = this; + if (self.$toggleProtected.length > 0) { + self.protected = self.$toggleProtected.prop("checked"); + var $elem = $(".symbol-title.protected,.symbol-details.protected,li.protected"); + if (!self.inherited) { + $elem = $elem.not(".inherited"); + } + $elem = $elem.add($elem.filter(".symbol-title").prev("hr")); + $elem.toggle(self.protected); + self.$toggleProtected.closest(".checkbox-inline").toggleClass("checked", self.protected); + } + }, + setPrivate: function () { + var self = this; + if (self.$togglePrivate.length > 0) { + self.private = self.$togglePrivate.prop("checked"); + var $elem = $(".symbol-title.private,.symbol-details.private,li.private"); + if (!self.inherited) { + $elem = $elem.not(".inherited"); + } + $elem = $elem.add($elem.filter(".symbol-title").prev("hr")); + $elem.toggle(self.private); + self.$togglePrivate.closest(".checkbox-inline").toggleClass("checked", self.private); + } + }, + onInheritedChanged: function (e) { + e.data.self.setInherited(); + }, + onPublicChanged: function (e) { + e.data.self.setPublic(); + }, + onProtectedChanged: function (e) { + e.data.self.setProtected(); + }, + onPrivateChanged: function (e) { + e.data.self.setPrivate(); + }, + }); + + $(function () { + if (enabled) { + var filter = new AccessFilter(); + filter.init(); + } + }); +})(window.TEMPLATE_OPTIONS, window.DOCLET_AFILTER_ENABLED, jQuery); diff --git a/__DOCS__/JSDocTemplate/src/static/js/example-run.js b/__DOCS__/JSDocTemplate/src/static/js/example-run.js index 36647c2..bbdee88 100644 --- a/__DOCS__/JSDocTemplate/src/static/js/example-run.js +++ b/__DOCS__/JSDocTemplate/src/static/js/example-run.js @@ -1,35 +1,34 @@ -(function(options, $){ - - $(function(){ - - $('button.code-run').on('click', function(e){ - var $this = $(this); - var $textarea = $this.parent('p').next('textarea'); - if ($textarea.length == 0){ - $textarea = $('",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)), -void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("\r\n"; -},"2":function(container,depth0,helpers,partials,data) { - var stack1, alias1=container.lambda, alias2=container.escapeExpression; - - return " \r\n"; -},"4":function(container,depth0,helpers,partials,data) { - var helper, alias1=container.escapeExpression; - - return " \r\n"; -},"6":function(container,depth0,helpers,partials,data) { - var stack1, alias1=container.lambda, alias2=container.escapeExpression; - - return " \r\n"; -},"8":function(container,depth0,helpers,partials,data) { - var stack1, alias1=container.lambda; - - return "
\r\n
\r\n " - + container.escapeExpression(alias1(((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.kind : stack1), depth0)) - + "\r\n

" - + ((stack1 = alias1(((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.pageTitleHTML : stack1), depth0)) != null ? stack1 : "") - + "

\r\n" - + ((stack1 = container.invokePartial(partials["tag/summary"],(depth0 != null ? depth0.doclet : depth0),{"name":"tag/summary","data":data,"indent":"\t\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + "
\r\n
\r\n"; -},"10":function(container,depth0,helpers,partials,data) { - return "col-md-9"; -},"12":function(container,depth0,helpers,partials,data) { - return "col-md-12"; -},"14":function(container,depth0,helpers,partials,data) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.crumbs : depth0),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.showAccessFilter : stack1),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"15":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
    \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.crumbs : depth0),{"name":"each","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"16":function(container,depth0,helpers,partials,data) { - var stack1; - - return " " - + ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "") - + "\r\n"; -},"17":function(container,depth0,helpers,partials,data) { - return " class=\"active\""; -},"19":function(container,depth0,helpers,partials,data) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return "
\r\n" - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.has : stack1)) != null ? stack1.inherited : stack1),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.has : stack1)) != null ? stack1["public"] : stack1),{"name":"if","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.has : stack1)) != null ? stack1["protected"] : stack1),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.has : stack1)) != null ? stack1["private"] : stack1),{"name":"if","hash":{},"fn":container.program(26, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"20":function(container,depth0,helpers,partials,data) { - return " \r\n"; -},"22":function(container,depth0,helpers,partials,data) { - return " \r\n"; -},"24":function(container,depth0,helpers,partials,data) { - return " \r\n"; -},"26":function(container,depth0,helpers,partials,data) { - return " \r\n"; -},"28":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing; - - return "
\r\n" - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"primary",{"name":"block","hash":{},"fn":container.program(29, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"secondary",{"name":"block","hash":{},"fn":container.program(31, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"29":function(container,depth0,helpers,partials,data) { - return "
\r\n " - + container.escapeExpression((helpers.symbol || (depth0 && depth0.symbol) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.doclet : depth0),{"name":"symbol","hash":{"options":(depth0 != null ? depth0.options : depth0),"expanded":true,"primary":true},"data":data})) - + "\r\n
\r\n"; -},"31":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return "
\r\n" - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.module : stack1),{"name":"if","hash":{},"fn":container.program(32, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1["class"] : stack1),{"name":"if","hash":{},"fn":container.program(35, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.mixin : stack1),{"name":"if","hash":{},"fn":container.program(37, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.namespace : stack1),{"name":"if","hash":{},"fn":container.program(39, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.member : stack1),{"name":"if","hash":{},"fn":container.program(41, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1["function"] : stack1),{"name":"if","hash":{},"fn":container.program(43, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.typedef : stack1),{"name":"if","hash":{},"fn":container.program(45, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.event : stack1),{"name":"if","hash":{},"fn":container.program(47, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.tutorial : stack1),{"name":"if","hash":{},"fn":container.program(49, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"32":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Modules

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.module : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"33":function(container,depth0,helpers,partials,data,blockParams,depths) { - return "
\r\n " - + container.escapeExpression((helpers.symbol || (depth0 && depth0.symbol) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"symbol","hash":{"options":(depths[1] != null ? depths[1].options : depths[1])},"data":data})) - + "\r\n"; -},"35":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Classes

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1["class"] : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"37":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Mixins

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.mixin : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"39":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Namespaces

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.namespace : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"41":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Members

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.member : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"43":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Methods

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1["function"] : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"45":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Type Definitions

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.typedef : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"47":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Events

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.event : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"49":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return "

Tutorials

\r\n
\r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = ((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.symbols : stack1)) != null ? stack1.tutorial : stack1),{"name":"each","hash":{},"fn":container.program(33, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n"; -},"51":function(container,depth0,helpers,partials,data) { - return "
\r\n \r\n
\r\n"; -},"53":function(container,depth0,helpers,partials,data) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.footer : stack1),{"name":"if","hash":{},"fn":container.program(54, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.copyright : stack1),{"name":"if","hash":{},"fn":container.program(56, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
Documentation generated by JSDoc " - + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.config : depth0)) != null ? stack1.version : stack1), depth0)) - + "" - + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.includeDate : stack1),{"name":"if","hash":{},"fn":container.program(58, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ".
\r\n"; -},"54":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
" - + ((stack1 = container.lambda(((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.footer : stack1), depth0)) != null ? stack1 : "") - + "
\r\n"; -},"56":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
" - + ((stack1 = container.lambda(((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.copyright : stack1), depth0)) != null ? stack1 : "") - + "
\r\n"; -},"58":function(container,depth0,helpers,partials,data) { - var stack1; - - return " on " - + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.config : depth0)) != null ? stack1.date : stack1), depth0)); -},"60":function(container,depth0,helpers,partials,data) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing; - - return "
\r\n
"
-    + ((stack1 = (helpers.json || (depth0 && depth0.json) || alias2).call(alias1,(depth0 != null ? depth0.config : depth0),{"name":"json","hash":{"pretty":true},"data":data})) != null ? stack1 : "")
-    + "
\r\n
"
-    + ((stack1 = (helpers.json || (depth0 && depth0.json) || alias2).call(alias1,(depth0 != null ? depth0.doclet : depth0),{"name":"json","hash":{"pretty":true},"data":data})) != null ? stack1 : "")
-    + "
\r\n
\r\n"; -},"62":function(container,depth0,helpers,partials,data) { - var stack1, helper; - - return ((stack1 = container.invokePartial(partials["search/modal"],depth0,{"name":"search/modal","data":data,"indent":"\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + " \r\n"; -},"64":function(container,depth0,helpers,partials,data) { - var helper, alias1=container.escapeExpression; - - return " \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n" - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"head",{"name":"block","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n\r\n" - + ((stack1 = container.invokePartial(partials["site/navbar"],depth0,{"name":"site/navbar","data":data,"indent":"\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"page-header",{"name":"block","hash":{},"fn":container.program(8, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n
\r\n
\r\n" - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"controls",{"name":"block","hash":{},"fn":container.program(14, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"content",{"name":"block","hash":{},"fn":container.program(28, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n" - + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.showTableOfContents : stack1),{"name":"if","hash":{},"fn":container.program(51, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n
\r\n
\r\n" - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"footer",{"name":"block","hash":{},"fn":container.program(53, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
\r\n" - + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.config : depth0)) != null ? stack1.debug : stack1),{"name":"if","hash":{},"fn":container.program(60, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n \r\n \r\n \r\n \r\n \r\n" - + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.search : stack1),{"name":"if","hash":{},"fn":container.program(62, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers.each.call(alias1,((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.scripts : stack1),{"name":"each","hash":{},"fn":container.program(64, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n \r\n \r\n\r\n\r\n"; -},"usePartial":true,"useData":true,"useDepths":true})); - -Handlebars.registerPartial("site/navbar", this["tmpl"]["site/navbar"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - return " navbar-inverse"; -},"3":function(container,depth0,helpers,partials,data) { - return " branding-logo"; -},"5":function(container,depth0,helpers,partials,data) { - var stack1; - - return " style=\"background-image: url(" - + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.systemLogo : stack1), depth0)) - + ");\""; -},"7":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depths[1] != null ? depths[1].options : depths[1])) != null ? stack1.inlineNav : stack1),{"name":"if","hash":{},"fn":container.program(8, data, 0, blockParams, depths),"inverse":container.program(10, data, 0, blockParams, depths),"data":data})) != null ? stack1 : ""); -},"8":function(container,depth0,helpers,partials,data) { - var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
  • " - + alias4(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"title","hash":{},"data":data}) : helper))) - + "
  • \r\n"; -},"10":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.members : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.program(14, data, 0),"data":data})) != null ? stack1 : ""); -},"11":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
  • \r\n " - + alias4(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"title","hash":{},"data":data}) : helper))) - + "\r\n
      \r\n" - + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.members : depth0),{"name":"each","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n
  • \r\n"; -},"12":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
  • " - + ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "") - + "
  • \r\n"; -},"14":function(container,depth0,helpers,partials,data) { - var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
  • " - + alias4(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"title","hash":{},"data":data}) : helper))) - + "
  • \r\n"; -},"16":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = container.invokePartial(partials["search/navbar-input"],depth0,{"name":"search/navbar-input","data":data,"indent":"\t\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.lambda, alias3=container.escapeExpression; - - return "\r\n
    \r\n
    \r\n \r\n
    \r\n
      \r\n" - + ((stack1 = helpers.each.call(alias1,((stack1 = (depth0 != null ? depth0.navbar : depth0)) != null ? stack1.topLevel : stack1),{"name":"each","hash":{},"fn":container.program(7, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n" - + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.search : stack1),{"name":"if","hash":{},"fn":container.program(16, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n
    \r\n"; -},"usePartial":true,"useData":true,"useDepths":true})); - -Handlebars.registerPartial("symbol/inline", this["tmpl"]["symbol/inline"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return " " - + container.escapeExpression(((helper = (helper = helpers.access || (depth0 != null ? depth0.access : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"access","hash":{},"data":data}) : helper))) - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.inherited : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - return " inherited"; -},"4":function(container,depth0,helpers,partials,data) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return ((stack1 = helpers.unless.call(alias1,(helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(alias1,"symbol-details",{"name":"content","hash":{},"data":data}),{"name":"unless","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"5":function(container,depth0,helpers,partials,data) { - var stack1; - - return " collapsible-symbol" - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.expanded),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"6":function(container,depth0,helpers,partials,data) { - return " expanded"; -},"8":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.primary),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.program(11, data, 0),"data":data})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/summary"],depth0,{"name":"tag/summary","data":data,"indent":"\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"9":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function"; - - return "

    " - + ((stack1 = ((helper = (helper = helpers.primaryTitleHTML || (depth0 != null ? depth0.primaryTitleHTML : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"primaryTitleHTML","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "

    \r\n"; -},"11":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.list),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.program(14, data, 0),"data":data})) != null ? stack1 : ""); -},"12":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "

    " - + ((stack1 = ((helper = (helper = helpers.listTitleHTML || (depth0 != null ? depth0.listTitleHTML : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"listTitleHTML","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "

    \r\n"; -},"14":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "

    " - + ((stack1 = ((helper = (helper = helpers.symbolTitleHTML || (depth0 != null ? depth0.symbolTitleHTML : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"symbolTitleHTML","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "

    \r\n "; -},"16":function(container,depth0,helpers,partials,data) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return ((stack1 = helpers.unless.call(alias1,(helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(alias1,"symbol-details",{"name":"content","hash":{},"data":data}),{"name":"unless","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"17":function(container,depth0,helpers,partials,data) { - var stack1; - - return " collapsible-symbol" - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(data && data.expanded),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"19":function(container,depth0,helpers,partials,data) { - return " style=\"max-height: 9999px;\""; -},"21":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = container.invokePartial(partials["tag/description"],depth0,{"name":"tag/description","data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/param"],depth0,{"name":"tag/param","data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/prop"],depth0,{"name":"tag/prop","data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/returns"],depth0,{"name":"tag/returns","data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/requires"],depth0,{"name":"tag/requires","data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/example"],depth0,{"name":"tag/example","hash":{"options":(data && data.options)},"data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/fires"],depth0,{"name":"tag/fires","data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/exceptions"],depth0,{"name":"tag/exceptions","data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/details"],depth0,{"name":"tag/details","hash":{"options":(data && data.options)},"data":data,"indent":"\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
    \r\n" - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"symbol-title",{"name":"block","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n
    \r\n" - + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1,"symbol-details",{"name":"block","hash":{},"fn":container.program(21, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n
    "; -},"usePartial":true,"useData":true})); - -Handlebars.registerPartial("symbol/page", this["tmpl"]["symbol/page"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return " " - + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"symbol-details",{"name":"content","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n"; -},"2":function(container,depth0,helpers,partials,data) { - return ""; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"symbol/inline",{"name":"extend","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("symbol/tutorial", this["tmpl"]["symbol/tutorial"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"symbol-details",{"name":"content","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
    \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.children : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { - return "
    \r\n " - + container.escapeExpression((helpers.symbol || (depth0 && depth0.symbol) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"symbol","hash":{"options":(data && data.options),"primary":(depth0 != null ? depth0.primary : depth0),"list":(depth0 != null ? depth0.list : depth0)},"data":data})) - + "\r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"symbol/inline",{"name":"extend","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("tag/description", this["tmpl"]["tag/description"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Description","callout-primary",{"name":"callout","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - var stack1, helper; - - return "
    " - + ((stack1 = ((helper = (helper = helpers.classdesc || (depth0 != null ? depth0.classdesc : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"classdesc","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    \r\n"; -},"4":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.description : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"5":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Description","callout-primary",{"name":"callout","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"6":function(container,depth0,helpers,partials,data) { - var stack1, helper; - - return "
    " - + ((stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"description","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.classdesc : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("tag/details", this["tmpl"]["tag/details"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Details","callout-default",{"name":"callout","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return "
    \r\n\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.defaultvalue : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.augments : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.version : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.since : depth0),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.inherits : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.overrides : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.implementations : depth0),{"name":"if","hash":{},"fn":container.program(21, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0["implements"] : depth0),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.mixes : depth0),{"name":"if","hash":{},"fn":container.program(27, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.deprecated : depth0),{"name":"if","hash":{},"fn":container.program(30, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.author : depth0),{"name":"if","hash":{},"fn":container.program(32, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.copyright : depth0),{"name":"if","hash":{},"fn":container.program(35, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.license : depth0),{"name":"if","hash":{},"fn":container.program(37, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasSource : depth0),{"name":"if","hash":{},"fn":container.program(39, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tutorials : depth0),{"name":"if","hash":{},"fn":container.program(44, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.see : depth0),{"name":"if","hash":{},"fn":container.program(47, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.todo : depth0),{"name":"if","hash":{},"fn":container.program(50, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { - return " \r\n
    \r\n \r\n
    \r\n
    " - + container.escapeExpression((helpers["type-names"] || (depth0 && depth0["type-names"]) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.type : depth0),{"name":"type-names","hash":{},"data":data})) - + "
    \r\n
    \r\n
    \r\n"; -},"5":function(container,depth0,helpers,partials,data) { - var helper; - - return " \r\n
    \r\n \r\n
    \r\n

    " - + container.escapeExpression(((helper = (helper = helpers.defaultvalue || (depth0 != null ? depth0.defaultvalue : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultvalue","hash":{},"data":data}) : helper))) - + "

    \r\n
    \r\n
    \r\n"; -},"7":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n" - + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.augments : depth0),{"name":"single","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(10, data, 0),"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"8":function(container,depth0,helpers,partials,data) { - return "

    " - + container.escapeExpression((helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"linkto","hash":{},"data":data})) - + "

    \r\n"; -},"10":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.augments : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"11":function(container,depth0,helpers,partials,data) { - return "
  • " - + container.escapeExpression((helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"linkto","hash":{},"data":data})) - + "
  • \r\n"; -},"13":function(container,depth0,helpers,partials,data) { - var helper; - - return " \r\n
    \r\n \r\n
    \r\n

    " - + container.escapeExpression(((helper = (helper = helpers.version || (depth0 != null ? depth0.version : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"version","hash":{},"data":data}) : helper))) - + "

    \r\n
    \r\n
    \r\n"; -},"15":function(container,depth0,helpers,partials,data) { - var helper; - - return " \r\n
    \r\n \r\n
    \r\n

    " - + container.escapeExpression(((helper = (helper = helpers.since || (depth0 != null ? depth0.since : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"since","hash":{},"data":data}) : helper))) - + "

    \r\n
    \r\n
    \r\n"; -},"17":function(container,depth0,helpers,partials,data) { - return " \r\n
    \r\n \r\n
    \r\n

    " - + container.escapeExpression((helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.inherits : depth0),{"name":"linkto","hash":{},"data":data})) - + "

    \r\n
    \r\n
    \r\n"; -},"19":function(container,depth0,helpers,partials,data) { - return " \r\n
    \r\n \r\n
    \r\n

    " - + container.escapeExpression((helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.overrides : depth0),{"name":"linkto","hash":{},"data":data})) - + "

    \r\n
    \r\n
    \r\n"; -},"21":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n" - + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.implementations : depth0),{"name":"single","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(22, data, 0),"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"22":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.implementations : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"24":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n" - + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0["implements"] : depth0),{"name":"single","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(25, data, 0),"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"25":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0["implements"] : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"27":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n" - + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.mixes : depth0),{"name":"single","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(28, data, 0),"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"28":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.mixes : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"30":function(container,depth0,helpers,partials,data) { - var helper; - - return " \r\n
    \r\n \r\n
    \r\n

    " - + container.escapeExpression(((helper = (helper = helpers.deprecated || (depth0 != null ? depth0.deprecated : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"deprecated","hash":{},"data":data}) : helper))) - + "

    \r\n
    \r\n
    \r\n"; -},"32":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n" - + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.author : depth0),{"name":"single","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(33, data, 0),"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"33":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.author : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"35":function(container,depth0,helpers,partials,data) { - var helper; - - return " \r\n
    \r\n \r\n
    \r\n

    " - + container.escapeExpression(((helper = (helper = helpers.copyright || (depth0 != null ? depth0.copyright : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"copyright","hash":{},"data":data}) : helper))) - + "

    \r\n
    \r\n
    \r\n"; -},"37":function(container,depth0,helpers,partials,data) { - var helper; - - return " \r\n
    \r\n \r\n
    \r\n

    " - + container.escapeExpression(((helper = (helper = helpers.license || (depth0 != null ? depth0.license : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"license","hash":{},"data":data}) : helper))) - + "

    \r\n
    \r\n
    \r\n"; -},"39":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n

    " - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? depth0.options : depth0)) != null ? stack1.outputSourceFiles : stack1),{"name":"if","hash":{},"fn":container.program(40, data, 0),"inverse":container.program(42, data, 0),"data":data})) != null ? stack1 : "") - + "

    \r\n
    \r\n
    \r\n"; -},"40":function(container,depth0,helpers,partials,data) { - var stack1, helper; - - return ((stack1 = ((helper = (helper = helpers.sourcelink || (depth0 != null ? depth0.sourcelink : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"sourcelink","hash":{},"data":data}) : helper))) != null ? stack1 : ""); -},"42":function(container,depth0,helpers,partials,data) { - var helper; - - return container.escapeExpression(((helper = (helper = helpers.source || (depth0 != null ? depth0.source : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"source","hash":{},"data":data}) : helper))); -},"44":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n" - + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.tutorials : depth0),{"name":"single","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(45, data, 0),"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"45":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.tutorials : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"47":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n" - + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.see : depth0),{"name":"single","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(48, data, 0),"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"48":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.see : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"50":function(container,depth0,helpers,partials,data) { - var stack1; - - return " \r\n
    \r\n \r\n
    \r\n" - + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.todo : depth0),{"name":"single","hash":{},"fn":container.program(51, data, 0),"inverse":container.program(53, data, 0),"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"51":function(container,depth0,helpers,partials,data) { - return "

    " - + container.escapeExpression(container.lambda(depth0, depth0)) - + "

    \r\n"; -},"53":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.todo : depth0),{"name":"each","hash":{},"fn":container.program(54, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"54":function(container,depth0,helpers,partials,data) { - return "
  • " - + container.escapeExpression(container.lambda(depth0, depth0)) - + "
  • \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.hasDetails : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("tag/example", this["tmpl"]["tag/example"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Examples","callout-example",{"name":"callout","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.examples : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"3":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.caption : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"
    -    + alias4(((helper = (helper = helpers.code || (depth0 != null ? depth0.code : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"code","hash":{},"data":data}) : helper)))
    -    + "
    \r\n
    \r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.run : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"4":function(container,depth0,helpers,partials,data) { - var stack1, helper; - - return "
    " - + ((stack1 = ((helper = (helper = helpers.caption || (depth0 != null ? depth0.caption : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"caption","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    \r\n"; -},"6":function(container,depth0,helpers,partials,data) { - var helper; - - return "

    \r\n \r\n \r\n

    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.examples : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("tag/exceptions", this["tmpl"]["tag/exceptions"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Throws","callout-danger",{"name":"callout","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
    \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.exceptions : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing; - - return "
    \r\n \r\n
    \r\n
    " - + ((stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"description","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    \r\n
    \r\n
    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.exceptions : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("tag/fires", this["tmpl"]["tag/fires"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Fires","callout-warning",{"name":"callout","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
    \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.fires : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function"; - - return "
    \r\n \r\n
    \r\n
    " - + ((stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"summary","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    \r\n
    \r\n
    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.fires : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("tag/param", this["tmpl"]["tag/param"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.child : depth0),{"name":"unless","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n \r\n \r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.paramsHasNames : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.paramsHasAttributes : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.paramsHasDefaults : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n \r\n \r\n \r\n" - + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.params : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n
    TypeDescription
    \r\n" - + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.child : depth0),{"name":"unless","hash":{},"fn":container.program(21, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - return "
    \r\n
    Parameters
    \r\n"; -},"4":function(container,depth0,helpers,partials,data) { - return " Name\r\n"; -},"6":function(container,depth0,helpers,partials,data) { - return " Attributes\r\n"; -},"8":function(container,depth0,helpers,partials,data) { - return " Default\r\n"; -},"10":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return " \r\n" - + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].paramsHasNames : depths[1]),{"name":"if","hash":{},"fn":container.program(11, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " " - + container.escapeExpression((helpers["type-names"] || (depth0 && depth0["type-names"]) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"type-names","hash":{},"data":data})) - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].paramsHasAttributes : depths[1]),{"name":"if","hash":{},"fn":container.program(13, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].paramsHasDefaults : depths[1]),{"name":"if","hash":{},"fn":container.program(15, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.params : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n \r\n"; -},"11":function(container,depth0,helpers,partials,data) { - var helper; - - return " " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data}) : helper))) - + "\r\n"; -},"13":function(container,depth0,helpers,partials,data) { - return " " - + container.escapeExpression((helpers["param-attribs"] || (depth0 && depth0["param-attribs"]) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"param-attribs","hash":{},"data":data})) - + "\r\n"; -},"15":function(container,depth0,helpers,partials,data) { - var helper; - - return " " - + container.escapeExpression(((helper = (helper = helpers.defaultvalue || (depth0 != null ? depth0.defaultvalue : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultvalue","hash":{},"data":data}) : helper))) - + "\r\n"; -},"17":function(container,depth0,helpers,partials,data) { - var stack1, helper; - - return " " - + ((stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"description","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "\r\n"; -},"19":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = container.invokePartial(partials["tag/param"],depth0,{"name":"tag/param","hash":{"child":true},"data":data,"indent":"\t\t\t\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"21":function(container,depth0,helpers,partials,data) { - return "
    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.params : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"usePartial":true,"useData":true,"useDepths":true})); - -Handlebars.registerPartial("tag/prop", this["tmpl"]["tag/prop"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.child : depth0),{"name":"unless","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n \r\n \r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.propertiesHasNames : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.propertiesHasAttributes : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.propertiesHasDefaults : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n \r\n \r\n \r\n" - + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.properties : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n
    TypeDescription
    \r\n" - + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.child : depth0),{"name":"unless","hash":{},"fn":container.program(21, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - return "
    \r\n
    Properties
    \r\n"; -},"4":function(container,depth0,helpers,partials,data) { - return " Name\r\n"; -},"6":function(container,depth0,helpers,partials,data) { - return " Attributes\r\n"; -},"8":function(container,depth0,helpers,partials,data) { - return " Default\r\n"; -},"10":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return " \r\n" - + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].propertiesHasNames : depths[1]),{"name":"if","hash":{},"fn":container.program(11, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " " - + container.escapeExpression((helpers["type-names"] || (depth0 && depth0["type-names"]) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"type-names","hash":{},"data":data})) - + "\r\n" - + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].propertiesHasAttributes : depths[1]),{"name":"if","hash":{},"fn":container.program(13, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,(depths[1] != null ? depths[1].propertiesHasDefaults : depths[1]),{"name":"if","hash":{},"fn":container.program(15, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.properties : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + " \r\n \r\n"; -},"11":function(container,depth0,helpers,partials,data) { - var helper; - - return " " - + container.escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data}) : helper))) - + "\r\n"; -},"13":function(container,depth0,helpers,partials,data) { - return " " - + container.escapeExpression((helpers["param-attribs"] || (depth0 && depth0["param-attribs"]) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"param-attribs","hash":{},"data":data})) - + "\r\n"; -},"15":function(container,depth0,helpers,partials,data) { - var helper; - - return " " - + container.escapeExpression(((helper = (helper = helpers.defaultvalue || (depth0 != null ? depth0.defaultvalue : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultvalue","hash":{},"data":data}) : helper))) - + "\r\n"; -},"17":function(container,depth0,helpers,partials,data) { - var stack1, helper; - - return " " - + ((stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"description","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "\r\n"; -},"19":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = container.invokePartial(partials["tag/prop"],depth0,{"name":"tag/prop","hash":{"child":true},"data":data,"indent":"\t\t\t\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"21":function(container,depth0,helpers,partials,data) { - return "
    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.properties : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"usePartial":true,"useData":true,"useDepths":true})); - -Handlebars.registerPartial("tag/requires", this["tmpl"]["tag/requires"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Requires","callout-warning",{"name":"callout","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
    \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.requires : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function"; - - return "
    \r\n \r\n
    \r\n
    " - + ((stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"summary","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    \r\n
    \r\n
    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.requires : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("tag/returns", this["tmpl"]["tag/returns"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Returns","callout-success",{"name":"callout","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { - var stack1; - - return "
    \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.returns : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing; - - return "
    \r\n \r\n
    \r\n
    " - + ((stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"description","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    \r\n
    \r\n
    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.returns : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -Handlebars.registerPartial("tag/summary", this["tmpl"]["tag/summary"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { - var stack1, helper; - - return "
    " - + ((stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"summary","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    "; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.summary : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true})); - -this["tmpl"]["doclet"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { +Handlebars.registerPartial( + "search/modal", + (this["tmpl"]["search/modal"] = Handlebars.template({ + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + return '\r\n\r\n\r\n'; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "search/navbar-input", + (this["tmpl"]["search/navbar-input"] = Handlebars.template({ + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + return '\r\n\r\n'; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "site/layout", + (this["tmpl"]["site/layout"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = container.escapeExpression, + alias2 = depth0 != null ? depth0 : container.nullContext || {}, + alias3 = helpers.helperMissing, + alias4 = "function"; + + return ( + " " + + alias1( + container.lambda( + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.pageTitle : stack1, + depth0 + ) + ) + + "\r\n" + + ((stack1 = helpers["if"].call( + alias2, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.favicon : stack1, + { + name: "if", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ' \r\n \r\n \r\n \r\n \r\n' + + ((stack1 = helpers.each.call( + alias2, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.stylesheets : stack1, + { + name: "each", + hash: {}, + fn: container.program(4, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias2, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.systemColor : stack1, + { + name: "if", + hash: {}, + fn: container.program(6, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ' \r\n" + ); + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = container.lambda, + alias2 = container.escapeExpression; + + return ( + ' \r\n' + ); + }, + 4: function (container, depth0, helpers, partials, data) { + var helper, + alias1 = container.escapeExpression; + + return ( + ' \r\n' + ); + }, + 6: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = container.lambda, + alias2 = container.escapeExpression; + + return ( + " \r\n" + ); + }, + 8: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = container.lambda; + + return ( + ' \r\n" + ); + }, + 10: function (container, depth0, helpers, partials, data) { + return "col-md-9"; + }, + 12: function (container, depth0, helpers, partials, data) { + return "col-md-12"; + }, + 14: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.crumbs : depth0, { + name: "if", + hash: {}, + fn: container.program(15, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.showAccessFilter : stack1, + { + name: "if", + hash: {}, + fn: container.program(19, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + ); + }, + 15: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n" + ); + }, + 16: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + " " + + ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "") + + "\r\n" + ); + }, + 17: function (container, depth0, helpers, partials, data) { + return ' class="active"'; + }, + 19: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + '
    \r\n' + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.has : stack1) != null + ? stack1.inherited + : stack1, + { + name: "if", + hash: {}, + fn: container.program(20, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.has : stack1) != null + ? stack1["public"] + : stack1, + { + name: "if", + hash: {}, + fn: container.program(22, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.has : stack1) != null + ? stack1["protected"] + : stack1, + { + name: "if", + hash: {}, + fn: container.program(24, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.has : stack1) != null + ? stack1["private"] + : stack1, + { + name: "if", + hash: {}, + fn: container.program(26, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 20: function (container, depth0, helpers, partials, data) { + return ' \r\n'; + }, + 22: function (container, depth0, helpers, partials, data) { + return ' \r\n'; + }, + 24: function (container, depth0, helpers, partials, data) { + return ' \r\n'; + }, + 26: function (container, depth0, helpers, partials, data) { + return ' \r\n'; + }, + 28: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing; + + return ( + "
    \r\n" + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "primary", { + name: "block", + hash: {}, + fn: container.program(29, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "secondary", { + name: "block", + hash: {}, + fn: container.program(31, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 29: function (container, depth0, helpers, partials, data) { + return ( + '
    \r\n ' + + container.escapeExpression( + (helpers.symbol || (depth0 && depth0.symbol) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.doclet : depth0, + { + name: "symbol", + hash: { + options: depth0 != null ? depth0.options : depth0, + expanded: true, + primary: true, + }, + data: data, + } + ) + ) + + "\r\n
    \r\n" + ); + }, + 31: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + '
    \r\n' + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.module + : stack1, + { + name: "if", + hash: {}, + fn: container.program(32, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1["class"] + : stack1, + { + name: "if", + hash: {}, + fn: container.program(35, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.mixin + : stack1, + { + name: "if", + hash: {}, + fn: container.program(37, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.namespace + : stack1, + { + name: "if", + hash: {}, + fn: container.program(39, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.member + : stack1, + { + name: "if", + hash: {}, + fn: container.program(41, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1["function"] + : stack1, + { + name: "if", + hash: {}, + fn: container.program(43, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.typedef + : stack1, + { + name: "if", + hash: {}, + fn: container.program(45, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.event + : stack1, + { + name: "if", + hash: {}, + fn: container.program(47, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.tutorial + : stack1, + { + name: "if", + hash: {}, + fn: container.program(49, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 32: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Modules

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.module + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 33: function (container, depth0, helpers, partials, data, blockParams, depths) { + return ( + "
    \r\n " + + container.escapeExpression( + (helpers.symbol || (depth0 && depth0.symbol) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0, + { + name: "symbol", + hash: { + options: depths[1] != null ? depths[1].options : depths[1], + }, + data: data, + } + ) + ) + + "\r\n" + ); + }, + 35: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Classes

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1["class"] + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 37: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Mixins

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.mixin + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 39: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Namespaces

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.namespace + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 41: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Members

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.member + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 43: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Methods

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1["function"] + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 45: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Type Definitions

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.typedef + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 47: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Events

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.event + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 49: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return ( + '

    Tutorials

    \r\n
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.symbols : stack1) != null + ? stack1.tutorial + : stack1, + { + name: "each", + hash: {}, + fn: container.program(33, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 51: function (container, depth0, helpers, partials, data) { + return '
    \r\n \r\n
    \r\n'; + }, + 53: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + ((stack1 = helpers["if"].call( + alias1, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.footer : stack1, + { + name: "if", + hash: {}, + fn: container.program(54, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.copyright : stack1, + { + name: "if", + hash: {}, + fn: container.program(56, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + '
    Documentation generated by JSDoc ' + + container.escapeExpression( + container.lambda((stack1 = depth0 != null ? depth0.config : depth0) != null ? stack1.version : stack1, depth0) + ) + + "" + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.includeDate : stack1, + { + name: "if", + hash: {}, + fn: container.program(58, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ".
    \r\n" + ); + }, + 54: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n" + ); + }, + 56: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n" + ); + }, + 58: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + " on " + + container.escapeExpression( + container.lambda((stack1 = depth0 != null ? depth0.config : depth0) != null ? stack1.date : stack1, depth0) + ) + ); + }, + 60: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing; + + return ( + '
    \r\n
    ' +
    +        ((stack1 = (helpers.json || (depth0 && depth0.json) || alias2).call(
    +          alias1,
    +          depth0 != null ? depth0.config : depth0,
    +          { name: "json", hash: { pretty: true }, data: data }
    +        )) != null
    +          ? stack1
    +          : "") +
    +        '
    \r\n
    ' +
    +        ((stack1 = (helpers.json || (depth0 && depth0.json) || alias2).call(
    +          alias1,
    +          depth0 != null ? depth0.doclet : depth0,
    +          { name: "json", hash: { pretty: true }, data: data }
    +        )) != null
    +          ? stack1
    +          : "") +
    +        "
    \r\n
    \r\n" + ); + }, + 62: function (container, depth0, helpers, partials, data) { + var stack1, helper; + + return ( + ((stack1 = container.invokePartial(partials["search/modal"], depth0, { + name: "search/modal", + data: data, + indent: "\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ' \r\n' + ); + }, + 64: function (container, depth0, helpers, partials, data) { + var helper, + alias1 = container.escapeExpression; + + return ( + ' \r\n' + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + "\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n" + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "head", { + name: "block", + hash: {}, + fn: container.program(1, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n\r\n" + + ((stack1 = container.invokePartial(partials["site/navbar"], depth0, { + name: "site/navbar", + data: data, + indent: "\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "page-header", { + name: "block", + hash: {}, + fn: container.program(8, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + '
    \r\n
    \r\n
    \r\n' + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "controls", { + name: "block", + hash: {}, + fn: container.program(14, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "content", { + name: "block", + hash: {}, + fn: container.program(28, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "
    \r\n" + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.showTableOfContents : stack1, + { + name: "if", + hash: {}, + fn: container.program(51, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n
    \r\n" + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "footer", { + name: "block", + hash: {}, + fn: container.program(53, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "
    \r\n" + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = depth0 != null ? depth0.config : depth0) != null ? stack1.debug : stack1, + { + name: "if", + hash: {}, + fn: container.program(60, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ' \r\n \r\n \r\n \r\n \r\n \r\n' + + ((stack1 = helpers["if"].call( + alias1, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.search : stack1, + { + name: "if", + hash: {}, + fn: container.program(62, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = helpers.each.call( + alias1, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.scripts : stack1, + { + name: "each", + hash: {}, + fn: container.program(64, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ' \r\n \r\n \r\n\r\n\r\n' + ); + }, + usePartial: true, + useData: true, + useDepths: true, + })) +); + +Handlebars.registerPartial( + "site/navbar", + (this["tmpl"]["site/navbar"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + return " navbar-inverse"; + }, + 3: function (container, depth0, helpers, partials, data) { + return " branding-logo"; + }, + 5: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' style="background-image: url(' + + container.escapeExpression( + container.lambda( + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.systemLogo : stack1, + depth0 + ) + ) + + ');"' + ); + }, + 7: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = depths[1] != null ? depths[1].options : depths[1]) != null ? stack1.inlineNav : stack1, + { + name: "if", + hash: {}, + fn: container.program(8, data, 0, blockParams, depths), + inverse: container.program(10, data, 0, blockParams, depths), + data: data, + } + )) != null + ? stack1 + : ""; + }, + 8: function (container, depth0, helpers, partials, data) { + var helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + '
  • ' + + alias4( + ((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias2), + typeof helper === alias3 ? helper.call(alias1, { name: "title", hash: {}, data: data }) : helper) + ) + + "
  • \r\n" + ); + }, + 10: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.members : depth0, + { + name: "if", + hash: {}, + fn: container.program(11, data, 0), + inverse: container.program(14, data, 0), + data: data, + } + )) != null + ? stack1 + : ""; + }, + 11: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + ' \r\n" + ); + }, + 12: function (container, depth0, helpers, partials, data) { + var stack1; + + return "
  • " + ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "") + "
  • \r\n"; + }, + 14: function (container, depth0, helpers, partials, data) { + var helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + '
  • ' + + alias4( + ((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias2), + typeof helper === alias3 ? helper.call(alias1, { name: "title", hash: {}, data: data }) : helper) + ) + + "
  • \r\n" + ); + }, + 16: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = container.invokePartial(partials["search/navbar-input"], depth0, { + name: "search/navbar-input", + data: data, + indent: "\t\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : ""; + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = container.lambda, + alias3 = container.escapeExpression; + + return ( + '\r\n\r\n" + ); + }, + usePartial: true, + useData: true, + useDepths: true, + })) +); + +Handlebars.registerPartial( + "symbol/inline", + (this["tmpl"]["symbol/inline"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + " " + + container.escapeExpression( + ((helper = + (helper = helpers.access || (depth0 != null ? depth0.access : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" ? helper.call(alias1, { name: "access", hash: {}, data: data }) : helper) + ) + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.inherited : depth0, { + name: "if", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + ); + }, + 2: function (container, depth0, helpers, partials, data) { + return " inherited"; + }, + 4: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return (stack1 = helpers.unless.call( + alias1, + (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(alias1, "symbol-details", { + name: "content", + hash: {}, + data: data, + }), + { + name: "unless", + hash: {}, + fn: container.program(5, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 5: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + " collapsible-symbol" + + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : container.nullContext || {}, data && data.expanded, { + name: "if", + hash: {}, + fn: container.program(6, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + ); + }, + 6: function (container, depth0, helpers, partials, data) { + return " expanded"; + }, + 8: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : container.nullContext || {}, data && data.primary, { + name: "if", + hash: {}, + fn: container.program(9, data, 0), + inverse: container.program(11, data, 0), + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/summary"], depth0, { + name: "tag/summary", + data: data, + indent: "\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + ); + }, + 9: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function"; + + return ( + '

    ' + + ((stack1 = + ((helper = + (helper = helpers.primaryTitleHTML || (depth0 != null ? depth0.primaryTitleHTML : depth0)) != null + ? helper + : alias2), + typeof helper === alias3 + ? helper.call(alias1, { + name: "primaryTitleHTML", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "

    \r\n" + ); + }, + 11: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call(depth0 != null ? depth0 : container.nullContext || {}, data && data.list, { + name: "if", + hash: {}, + fn: container.program(12, data, 0), + inverse: container.program(14, data, 0), + data: data, + })) != null + ? stack1 + : ""; + }, + 12: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + '

    ' + + ((stack1 = + ((helper = + (helper = helpers.listTitleHTML || (depth0 != null ? depth0.listTitleHTML : depth0)) != null + ? helper + : alias2), + typeof helper === alias3 + ? helper.call(alias1, { + name: "listTitleHTML", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "

    \r\n" + ); + }, + 14: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + '

    ' + + ((stack1 = + ((helper = + (helper = helpers.symbolTitleHTML || (depth0 != null ? depth0.symbolTitleHTML : depth0)) != null + ? helper + : alias2), + typeof helper === alias3 + ? helper.call(alias1, { + name: "symbolTitleHTML", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "

    \r\n " + ); + }, + 16: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return (stack1 = helpers.unless.call( + alias1, + (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(alias1, "symbol-details", { + name: "content", + hash: {}, + data: data, + }), + { + name: "unless", + hash: {}, + fn: container.program(17, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 17: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + " collapsible-symbol" + + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : container.nullContext || {}, data && data.expanded, { + name: "if", + hash: {}, + fn: container.program(6, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + ); + }, + 19: function (container, depth0, helpers, partials, data) { + return ' style="max-height: 9999px;"'; + }, + 21: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ((stack1 = container.invokePartial(partials["tag/description"], depth0, { + name: "tag/description", + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/param"], depth0, { + name: "tag/param", + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/prop"], depth0, { + name: "tag/prop", + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/returns"], depth0, { + name: "tag/returns", + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/requires"], depth0, { + name: "tag/requires", + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/example"], depth0, { + name: "tag/example", + hash: { options: data && data.options }, + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/fires"], depth0, { + name: "tag/fires", + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/exceptions"], depth0, { + name: "tag/exceptions", + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/details"], depth0, { + name: "tag/details", + hash: { options: data && data.options }, + data: data, + indent: "\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + '
    \r\n' + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "symbol-title", { + name: "block", + hash: {}, + fn: container.program(8, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + '
    \r\n
    \r\n
    \r\n' + + ((stack1 = (helpers.block || (depth0 && depth0.block) || alias2).call(alias1, "symbol-details", { + name: "block", + hash: {}, + fn: container.program(21, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "
    \r\n
    " + ); + }, + usePartial: true, + useData: true, + })) +); + +Handlebars.registerPartial( + "symbol/page", + (this["tmpl"]["symbol/page"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + " " + + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "symbol-details", + { + name: "content", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "\r\n" + ); + }, + 2: function (container, depth0, helpers, partials, data) { + return ""; + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "symbol/inline", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "symbol/tutorial", + (this["tmpl"]["symbol/tutorial"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "symbol-details", + { + name: "content", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.children : depth0, + { + name: "each", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { + return ( + "
    \r\n " + + container.escapeExpression( + (helpers.symbol || (depth0 && depth0.symbol) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0, + { + name: "symbol", + hash: { + options: data && data.options, + primary: depth0 != null ? depth0.primary : depth0, + list: depth0 != null ? depth0.list : depth0, + }, + data: data, + } + ) + ) + + "\r\n" + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "symbol/inline", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "tag/description", + (this["tmpl"]["tag/description"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "Description", + "callout-primary", + { + name: "callout", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1, helper; + + return ( + '
    ' + + ((stack1 = + ((helper = + (helper = helpers.classdesc || (depth0 != null ? depth0.classdesc : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "classdesc", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 4: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.description : depth0, + { + name: "if", + hash: {}, + fn: container.program(5, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 5: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "Description", + "callout-primary", + { + name: "callout", + hash: {}, + fn: container.program(6, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 6: function (container, depth0, helpers, partials, data) { + var stack1, helper; + + return ( + '
    ' + + ((stack1 = + ((helper = + (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "description", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.classdesc : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.program(4, data, 0), + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "tag/details", + (this["tmpl"]["tag/details"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "Details", + "callout-default", + { + name: "callout", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + '
    \r\n\r\n' + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.type : depth0, { + name: "if", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.defaultvalue : depth0, { + name: "if", + hash: {}, + fn: container.program(5, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.augments : depth0, { + name: "if", + hash: {}, + fn: container.program(7, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.version : depth0, { + name: "if", + hash: {}, + fn: container.program(13, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.since : depth0, { + name: "if", + hash: {}, + fn: container.program(15, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.inherits : depth0, { + name: "if", + hash: {}, + fn: container.program(17, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.overrides : depth0, { + name: "if", + hash: {}, + fn: container.program(19, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.implementations : depth0, { + name: "if", + hash: {}, + fn: container.program(21, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0["implements"] : depth0, { + name: "if", + hash: {}, + fn: container.program(24, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.mixes : depth0, { + name: "if", + hash: {}, + fn: container.program(27, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.deprecated : depth0, { + name: "if", + hash: {}, + fn: container.program(30, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.author : depth0, { + name: "if", + hash: {}, + fn: container.program(32, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.copyright : depth0, { + name: "if", + hash: {}, + fn: container.program(35, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.license : depth0, { + name: "if", + hash: {}, + fn: container.program(37, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.hasSource : depth0, { + name: "if", + hash: {}, + fn: container.program(39, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.tutorials : depth0, { + name: "if", + hash: {}, + fn: container.program(44, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.see : depth0, { + name: "if", + hash: {}, + fn: container.program(47, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.todo : depth0, { + name: "if", + hash: {}, + fn: container.program(50, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { + return ( + ' \r\n
    \r\n \r\n
    \r\n
    ' + + container.escapeExpression( + (helpers["type-names"] || (depth0 && depth0["type-names"]) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.type : depth0, + { name: "type-names", hash: {}, data: data } + ) + ) + + "
    \r\n
    \r\n
    \r\n" + ); + }, + 5: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + container.escapeExpression( + ((helper = + (helper = helpers.defaultvalue || (depth0 != null ? depth0.defaultvalue : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "defaultvalue", + hash: {}, + data: data, + }) + : helper) + ) + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 7: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n' + + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.augments : depth0, + { + name: "single", + hash: {}, + fn: container.program(8, data, 0), + inverse: container.program(10, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + 8: function (container, depth0, helpers, partials, data) { + return ( + '

    ' + + container.escapeExpression( + (helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0, + { name: "linkto", hash: {}, data: data } + ) + ) + + "

    \r\n" + ); + }, + 10: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
      \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.augments : depth0, + { + name: "each", + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 11: function (container, depth0, helpers, partials, data) { + return ( + "
  • " + + container.escapeExpression( + (helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0, + { name: "linkto", hash: {}, data: data } + ) + ) + + "
  • \r\n" + ); + }, + 13: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + container.escapeExpression( + ((helper = + (helper = helpers.version || (depth0 != null ? depth0.version : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "version", + hash: {}, + data: data, + }) + : helper) + ) + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 15: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + container.escapeExpression( + ((helper = + (helper = helpers.since || (depth0 != null ? depth0.since : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "since", + hash: {}, + data: data, + }) + : helper) + ) + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 17: function (container, depth0, helpers, partials, data) { + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + container.escapeExpression( + (helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.inherits : depth0, + { name: "linkto", hash: {}, data: data } + ) + ) + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 19: function (container, depth0, helpers, partials, data) { + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + container.escapeExpression( + (helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.overrides : depth0, + { name: "linkto", hash: {}, data: data } + ) + ) + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 21: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n' + + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.implementations : depth0, + { + name: "single", + hash: {}, + fn: container.program(8, data, 0), + inverse: container.program(22, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + 22: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
      \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.implementations : depth0, + { + name: "each", + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 24: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n' + + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0["implements"] : depth0, + { + name: "single", + hash: {}, + fn: container.program(8, data, 0), + inverse: container.program(25, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + 25: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
      \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0["implements"] : depth0, + { + name: "each", + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 27: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n' + + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.mixes : depth0, + { + name: "single", + hash: {}, + fn: container.program(8, data, 0), + inverse: container.program(28, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + 28: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
      \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.mixes : depth0, + { + name: "each", + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 30: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + container.escapeExpression( + ((helper = + (helper = helpers.deprecated || (depth0 != null ? depth0.deprecated : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "deprecated", + hash: {}, + data: data, + }) + : helper) + ) + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 32: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n' + + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.author : depth0, + { + name: "single", + hash: {}, + fn: container.program(8, data, 0), + inverse: container.program(33, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + 33: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
      \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.author : depth0, + { + name: "each", + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 35: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + container.escapeExpression( + ((helper = + (helper = helpers.copyright || (depth0 != null ? depth0.copyright : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "copyright", + hash: {}, + data: data, + }) + : helper) + ) + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 37: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + container.escapeExpression( + ((helper = + (helper = helpers.license || (depth0 != null ? depth0.license : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "license", + hash: {}, + data: data, + }) + : helper) + ) + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 39: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n

    ' + + ((stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = depth0 != null ? depth0.options : depth0) != null ? stack1.outputSourceFiles : stack1, + { + name: "if", + hash: {}, + fn: container.program(40, data, 0), + inverse: container.program(42, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "

    \r\n
    \r\n
    \r\n" + ); + }, + 40: function (container, depth0, helpers, partials, data) { + var stack1, helper; + + return (stack1 = + ((helper = + (helper = helpers.sourcelink || (depth0 != null ? depth0.sourcelink : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "sourcelink", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : ""; + }, + 42: function (container, depth0, helpers, partials, data) { + var helper; + + return container.escapeExpression( + ((helper = + (helper = helpers.source || (depth0 != null ? depth0.source : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "source", + hash: {}, + data: data, + }) + : helper) + ); + }, + 44: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n' + + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.tutorials : depth0, + { + name: "single", + hash: {}, + fn: container.program(8, data, 0), + inverse: container.program(45, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + 45: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
      \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.tutorials : depth0, + { + name: "each", + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 47: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n' + + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.see : depth0, + { + name: "single", + hash: {}, + fn: container.program(8, data, 0), + inverse: container.program(48, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + 48: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
      \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.see : depth0, + { + name: "each", + hash: {}, + fn: container.program(11, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 50: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + ' \r\n
    \r\n \r\n
    \r\n' + + ((stack1 = (helpers.single || (depth0 && depth0.single) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.todo : depth0, + { + name: "single", + hash: {}, + fn: container.program(51, data, 0), + inverse: container.program(53, data, 0), + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + 51: function (container, depth0, helpers, partials, data) { + return ( + '

    ' + container.escapeExpression(container.lambda(depth0, depth0)) + "

    \r\n" + ); + }, + 53: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
      \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.todo : depth0, + { + name: "each", + hash: {}, + fn: container.program(54, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 54: function (container, depth0, helpers, partials, data) { + return "
  • " + container.escapeExpression(container.lambda(depth0, depth0)) + "
  • \r\n"; + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.hasDetails : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "tag/example", + (this["tmpl"]["tag/example"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "Examples", + "callout-example", + { + name: "callout", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.examples : depth0, + { + name: "each", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 3: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.caption : depth0, { + name: "if", + hash: {}, + fn: container.program(4, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + '
    \r\n
    \r\n' +
    +        alias4(
    +          ((helper = (helper = helpers.code || (depth0 != null ? depth0.code : depth0)) != null ? helper : alias2),
    +          typeof helper === alias3 ? helper.call(alias1, { name: "code", hash: {}, data: data }) : helper)
    +        ) +
    +        "
    \r\n
    \r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.run : depth0, { + name: "if", + hash: {}, + fn: container.program(6, data, 0), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + ); + }, + 4: function (container, depth0, helpers, partials, data) { + var stack1, helper; + + return ( + '
    ' + + ((stack1 = + ((helper = + (helper = helpers.caption || (depth0 != null ? depth0.caption : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "caption", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 6: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + '

    \r\n \r\n \r\n

    \r\n' + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.examples : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "tag/exceptions", + (this["tmpl"]["tag/exceptions"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "Throws", + "callout-danger", + { + name: "callout", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.exceptions : depth0, + { + name: "each", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing; + + return ( + '
    \r\n \r\n
    \r\n
    ' + + ((stack1 = + ((helper = + (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : alias2), + typeof helper === "function" + ? helper.call(alias1, { name: "description", hash: {}, data: data }) + : helper)) != null + ? stack1 + : "") + + "
    \r\n
    \r\n
    \r\n" + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.exceptions : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "tag/fires", + (this["tmpl"]["tag/fires"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "Fires", + "callout-warning", + { + name: "callout", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.fires : depth0, + { + name: "each", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function"; + + return ( + '
    \r\n \r\n
    \r\n
    ' + + ((stack1 = + ((helper = + (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : alias2), + typeof helper === alias3 ? helper.call(alias1, { name: "summary", hash: {}, data: data }) : helper)) != null + ? stack1 + : "") + + "
    \r\n
    \r\n
    \r\n" + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.fires : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "tag/param", + (this["tmpl"]["tag/param"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + ((stack1 = helpers.unless.call(alias1, depth0 != null ? depth0.child : depth0, { + name: "unless", + hash: {}, + fn: container.program(2, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ' \r\n \r\n \r\n' + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.paramsHasNames : depth0, { + name: "if", + hash: {}, + fn: container.program(4, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + " \r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.paramsHasAttributes : depth0, { + name: "if", + hash: {}, + fn: container.program(6, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.paramsHasDefaults : depth0, { + name: "if", + hash: {}, + fn: container.program(8, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ' \r\n \r\n \r\n \r\n' + + ((stack1 = helpers.each.call(alias1, depth0 != null ? depth0.params : depth0, { + name: "each", + hash: {}, + fn: container.program(10, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + " \r\n
    TypeDescription
    \r\n" + + ((stack1 = helpers.unless.call(alias1, depth0 != null ? depth0.child : depth0, { + name: "unless", + hash: {}, + fn: container.program(21, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + ); + }, + 2: function (container, depth0, helpers, partials, data) { + return '
    \r\n
    Parameters
    \r\n'; + }, + 4: function (container, depth0, helpers, partials, data) { + return " Name\r\n"; + }, + 6: function (container, depth0, helpers, partials, data) { + return " Attributes\r\n"; + }, + 8: function (container, depth0, helpers, partials, data) { + return " Default\r\n"; + }, + 10: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + " \r\n" + + ((stack1 = helpers["if"].call(alias1, depths[1] != null ? depths[1].paramsHasNames : depths[1], { + name: "if", + hash: {}, + fn: container.program(11, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + " " + + container.escapeExpression( + (helpers["type-names"] || (depth0 && depth0["type-names"]) || helpers.helperMissing).call( + alias1, + depth0 != null ? depth0.type : depth0, + { + name: "type-names", + hash: {}, + data: data, + } + ) + ) + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depths[1] != null ? depths[1].paramsHasAttributes : depths[1], { + name: "if", + hash: {}, + fn: container.program(13, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call(alias1, depths[1] != null ? depths[1].paramsHasDefaults : depths[1], { + name: "if", + hash: {}, + fn: container.program(15, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ' \r\n' + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.description : depth0, { + name: "if", + hash: {}, + fn: container.program(17, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.params : depth0, { + name: "if", + hash: {}, + fn: container.program(19, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + " \r\n \r\n" + ); + }, + 11: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + " " + + container.escapeExpression( + ((helper = + (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { name: "name", hash: {}, data: data }) + : helper) + ) + + "\r\n" + ); + }, + 13: function (container, depth0, helpers, partials, data) { + return ( + ' ' + + container.escapeExpression( + (helpers["param-attribs"] || (depth0 && depth0["param-attribs"]) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0, + { name: "param-attribs", hash: {}, data: data } + ) + ) + + "\r\n" + ); + }, + 15: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + " " + + container.escapeExpression( + ((helper = + (helper = helpers.defaultvalue || (depth0 != null ? depth0.defaultvalue : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "defaultvalue", + hash: {}, + data: data, + }) + : helper) + ) + + "\r\n" + ); + }, + 17: function (container, depth0, helpers, partials, data) { + var stack1, helper; + + return ( + " " + + ((stack1 = + ((helper = + (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "description", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "\r\n" + ); + }, + 19: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = container.invokePartial(partials["tag/param"], depth0, { + name: "tag/param", + hash: { child: true }, + data: data, + indent: "\t\t\t\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : ""; + }, + 21: function (container, depth0, helpers, partials, data) { + return "
    \r\n"; + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.params : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + usePartial: true, + useData: true, + useDepths: true, + })) +); + +Handlebars.registerPartial( + "tag/prop", + (this["tmpl"]["tag/prop"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + ((stack1 = helpers.unless.call(alias1, depth0 != null ? depth0.child : depth0, { + name: "unless", + hash: {}, + fn: container.program(2, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ' \r\n \r\n \r\n' + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.propertiesHasNames : depth0, { + name: "if", + hash: {}, + fn: container.program(4, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + " \r\n" + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.propertiesHasAttributes : depth0, { + name: "if", + hash: {}, + fn: container.program(6, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.propertiesHasDefaults : depth0, { + name: "if", + hash: {}, + fn: container.program(8, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ' \r\n \r\n \r\n \r\n' + + ((stack1 = helpers.each.call(alias1, depth0 != null ? depth0.properties : depth0, { + name: "each", + hash: {}, + fn: container.program(10, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + " \r\n
    TypeDescription
    \r\n" + + ((stack1 = helpers.unless.call(alias1, depth0 != null ? depth0.child : depth0, { + name: "unless", + hash: {}, + fn: container.program(21, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + ); + }, + 2: function (container, depth0, helpers, partials, data) { + return '
    \r\n
    Properties
    \r\n'; + }, + 4: function (container, depth0, helpers, partials, data) { + return " Name\r\n"; + }, + 6: function (container, depth0, helpers, partials, data) { + return " Attributes\r\n"; + }, + 8: function (container, depth0, helpers, partials, data) { + return " Default\r\n"; + }, + 10: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + " \r\n" + + ((stack1 = helpers["if"].call(alias1, depths[1] != null ? depths[1].propertiesHasNames : depths[1], { + name: "if", + hash: {}, + fn: container.program(11, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + " " + + container.escapeExpression( + (helpers["type-names"] || (depth0 && depth0["type-names"]) || helpers.helperMissing).call( + alias1, + depth0 != null ? depth0.type : depth0, + { + name: "type-names", + hash: {}, + data: data, + } + ) + ) + + "\r\n" + + ((stack1 = helpers["if"].call(alias1, depths[1] != null ? depths[1].propertiesHasAttributes : depths[1], { + name: "if", + hash: {}, + fn: container.program(13, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call(alias1, depths[1] != null ? depths[1].propertiesHasDefaults : depths[1], { + name: "if", + hash: {}, + fn: container.program(15, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ' \r\n' + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.description : depth0, { + name: "if", + hash: {}, + fn: container.program(17, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = helpers["if"].call(alias1, depth0 != null ? depth0.properties : depth0, { + name: "if", + hash: {}, + fn: container.program(19, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + " \r\n \r\n" + ); + }, + 11: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + " " + + container.escapeExpression( + ((helper = + (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { name: "name", hash: {}, data: data }) + : helper) + ) + + "\r\n" + ); + }, + 13: function (container, depth0, helpers, partials, data) { + return ( + ' ' + + container.escapeExpression( + (helpers["param-attribs"] || (depth0 && depth0["param-attribs"]) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0, + { name: "param-attribs", hash: {}, data: data } + ) + ) + + "\r\n" + ); + }, + 15: function (container, depth0, helpers, partials, data) { + var helper; + + return ( + " " + + container.escapeExpression( + ((helper = + (helper = helpers.defaultvalue || (depth0 != null ? depth0.defaultvalue : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "defaultvalue", + hash: {}, + data: data, + }) + : helper) + ) + + "\r\n" + ); + }, + 17: function (container, depth0, helpers, partials, data) { + var stack1, helper; + + return ( + " " + + ((stack1 = + ((helper = + (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "description", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "\r\n" + ); + }, + 19: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = container.invokePartial(partials["tag/prop"], depth0, { + name: "tag/prop", + hash: { child: true }, + data: data, + indent: "\t\t\t\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : ""; + }, + 21: function (container, depth0, helpers, partials, data) { + return "
    \r\n"; + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.properties : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + usePartial: true, + useData: true, + useDepths: true, + })) +); + +Handlebars.registerPartial( + "tag/requires", + (this["tmpl"]["tag/requires"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "Requires", + "callout-warning", + { + name: "callout", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.requires : depth0, + { + name: "each", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function"; + + return ( + '
    \r\n \r\n
    \r\n
    ' + + ((stack1 = + ((helper = + (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : alias2), + typeof helper === alias3 ? helper.call(alias1, { name: "summary", hash: {}, data: data }) : helper)) != null + ? stack1 + : "") + + "
    \r\n
    \r\n
    \r\n" + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.requires : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "tag/returns", + (this["tmpl"]["tag/returns"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = (helpers.callout || (depth0 && depth0.callout) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "Returns", + "callout-success", + { + name: "callout", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1; + + return ( + '
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.returns : depth0, + { + name: "each", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing; + + return ( + '
    \r\n \r\n
    \r\n
    ' + + ((stack1 = + ((helper = + (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : alias2), + typeof helper === "function" + ? helper.call(alias1, { name: "description", hash: {}, data: data }) + : helper)) != null + ? stack1 + : "") + + "
    \r\n
    \r\n
    \r\n" + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.returns : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +Handlebars.registerPartial( + "tag/summary", + (this["tmpl"]["tag/summary"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { + var stack1, helper; + + return ( + '
    ' + + ((stack1 = + ((helper = + (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null + ? helper + : helpers.helperMissing), + typeof helper === "function" + ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, { + name: "summary", + hash: {}, + data: data, + }) + : helper)) != null + ? stack1 + : "") + + "
    " + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { + var stack1; + + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.summary : depth0, + { + name: "if", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + })) +); + +this["tmpl"]["doclet"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { return "\r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { var stack1; - return ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"site/layout",{"name":"extend","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true}); - -this["tmpl"]["global"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { + return (stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "site/layout", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, +}); + +this["tmpl"]["global"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { var stack1; - return "\r\n" - + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"primary",{"name":"content","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n"; -},"2":function(container,depth0,helpers,partials,data) { + return ( + "\r\n" + + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "primary", + { + name: "content", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "\r\n" + ); + }, + 2: function (container, depth0, helpers, partials, data) { return ""; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { var stack1; - return ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"site/layout",{"name":"extend","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true}); - -this["tmpl"]["list"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing; - - return ((stack1 = (helpers.content || (depth0 && depth0.content) || alias2).call(alias1,"primary",{"name":"content","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = (helpers.content || (depth0 && depth0.content) || alias2).call(alias1,"secondary",{"name":"content","hash":{},"fn":container.program(4, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"2":function(container,depth0,helpers,partials,data) { + return (stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "site/layout", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, +}); + +this["tmpl"]["list"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing; + + return ( + ((stack1 = (helpers.content || (depth0 && depth0.content) || alias2).call(alias1, "primary", { + name: "content", + hash: {}, + fn: container.program(2, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + ((stack1 = (helpers.content || (depth0 && depth0.content) || alias2).call(alias1, "secondary", { + name: "content", + hash: {}, + fn: container.program(4, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + ); + }, + 2: function (container, depth0, helpers, partials, data) { var stack1; - return "

    " - + ((stack1 = container.lambda(((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.primaryTitleHTML : stack1), depth0)) != null ? stack1 : "") - + "

    \r\n"; -},"4":function(container,depth0,helpers,partials,data,blockParams,depths) { + return ( + "

    " + + ((stack1 = container.lambda( + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.primaryTitleHTML : stack1, + depth0 + )) != null + ? stack1 + : "") + + "

    \r\n" + ); + }, + 4: function (container, depth0, helpers, partials, data, blockParams, depths) { var stack1; - return "
    \r\n" - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.members : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"5":function(container,depth0,helpers,partials,data,blockParams,depths) { + return ( + '
    \r\n' + + ((stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.members : stack1, + { + name: "if", + hash: {}, + fn: container.program(5, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 5: function (container, depth0, helpers, partials, data, blockParams, depths) { var stack1; - return "
    \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.members : stack1),{"name":"each","hash":{},"fn":container.program(6, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"6":function(container,depth0,helpers,partials,data,blockParams,depths) { - var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}); - - return " " - + ((stack1 = helpers.unless.call(alias1,(data && data.first),{"name":"unless","hash":{},"fn":container.program(7, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n " - + container.escapeExpression((helpers.symbol || (depth0 && depth0.symbol) || helpers.helperMissing).call(alias1,depth0,{"name":"symbol","hash":{"options":(depths[1] != null ? depths[1].options : depths[1]),"list":true},"data":data})) - + "\r\n"; -},"7":function(container,depth0,helpers,partials,data) { + return ( + '
    \r\n' + + ((stack1 = helpers.each.call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.members : stack1, + { + name: "each", + hash: {}, + fn: container.program(6, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 6: function (container, depth0, helpers, partials, data, blockParams, depths) { + var stack1, + alias1 = depth0 != null ? depth0 : container.nullContext || {}; + + return ( + " " + + ((stack1 = helpers.unless.call(alias1, data && data.first, { + name: "unless", + hash: {}, + fn: container.program(7, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + })) != null + ? stack1 + : "") + + "\r\n " + + container.escapeExpression( + (helpers.symbol || (depth0 && depth0.symbol) || helpers.helperMissing).call(alias1, depth0, { + name: "symbol", + hash: { + options: depths[1] != null ? depths[1].options : depths[1], + list: true, + }, + data: data, + }) + ) + + "\r\n" + ); + }, + 7: function (container, depth0, helpers, partials, data) { return "
    "; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) { + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data, blockParams, depths) { var stack1; - return ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"site/layout",{"name":"extend","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"useData":true,"useDepths":true}); - -this["tmpl"]["module"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { + return (stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "site/layout", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0, blockParams, depths), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + useData: true, + useDepths: true, +}); + +this["tmpl"]["module"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { var stack1; - return "\r\n" - + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"primary",{"name":"content","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n"; -},"2":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
    \r\n
    \r\n
    \r\n
    \r\n" - + ((stack1 = container.invokePartial(partials["tag/description"],(depth0 != null ? depth0.doclet : depth0),{"name":"tag/description","data":data,"indent":"\t\t\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = helpers.each.call(alias1,((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.modules : stack1),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/requires"],(depth0 != null ? depth0.doclet : depth0),{"name":"tag/requires","data":data,"indent":"\t\t\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + ((stack1 = container.invokePartial(partials["tag/details"],(depth0 != null ? depth0.doclet : depth0),{"name":"tag/details","hash":{"options":(depth0 != null ? depth0.options : depth0)},"data":data,"indent":"\t\t\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "") - + "
    \r\n
    \r\n
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { + return ( + "\r\n" + + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "primary", + { + name: "content", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "\r\n" + ); + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1, + helper, + alias1 = depth0 != null ? depth0 : container.nullContext || {}, + alias2 = helpers.helperMissing, + alias3 = "function", + alias4 = container.escapeExpression; + + return ( + '
    \r\n
    \r\n
    \r\n
    \r\n' + + ((stack1 = container.invokePartial(partials["tag/description"], depth0 != null ? depth0.doclet : depth0, { + name: "tag/description", + data: data, + indent: "\t\t\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = helpers.each.call( + alias1, + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.modules : stack1, + { + name: "each", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/requires"], depth0 != null ? depth0.doclet : depth0, { + name: "tag/requires", + data: data, + indent: "\t\t\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + ((stack1 = container.invokePartial(partials["tag/details"], depth0 != null ? depth0.doclet : depth0, { + name: "tag/details", + hash: { options: depth0 != null ? depth0.options : depth0 }, + data: data, + indent: "\t\t\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : "") + + "
    \r\n
    \r\n
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { var stack1; - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.classdesc : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"4":function(container,depth0,helpers,partials,data) { + return (stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.classdesc : depth0, + { + name: "if", + hash: {}, + fn: container.program(4, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + 4: function (container, depth0, helpers, partials, data) { var stack1; - return ((stack1 = container.invokePartial(partials["tag/description"],depth0,{"name":"tag/description","data":data,"indent":"\t\t\t\t\t\t\t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : ""); -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return (stack1 = container.invokePartial(partials["tag/description"], depth0, { + name: "tag/description", + data: data, + indent: "\t\t\t\t\t\t\t", + helpers: helpers, + partials: partials, + decorators: container.decorators, + })) != null + ? stack1 + : ""; + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { var stack1; - return ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"site/layout",{"name":"extend","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); -},"usePartial":true,"useData":true}); - -this["tmpl"]["readme"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { + return (stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "site/layout", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : ""; + }, + usePartial: true, + useData: true, +}); + +this["tmpl"]["readme"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { var stack1; - return "\r\n" - + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"content",{"name":"content","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n"; -},"2":function(container,depth0,helpers,partials,data) { + return ( + "\r\n" + + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "content", + { + name: "content", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "\r\n" + ); + }, + 2: function (container, depth0, helpers, partials, data) { var stack1; - return "
    \r\n
    " - + ((stack1 = container.lambda(((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.contents : stack1), depth0)) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return ( + '
    \r\n
    ' + + ((stack1 = container.lambda( + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.contents : stack1, + depth0 + )) != null + ? stack1 + : "") + + "
    \r\n
    \r\n" + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { var stack1; - return "\r\n" - + ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"site/layout",{"name":"extend","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ""; -},"useData":true}); - -this["tmpl"]["source"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { + return ( + "\r\n" + + ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "site/layout", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "" + ); + }, + useData: true, +}); + +this["tmpl"]["source"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { var stack1; - return "\r\n" - + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"content",{"name":"content","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n"; -},"2":function(container,depth0,helpers,partials,data) { - var stack1, alias1=container.lambda; - - return "
    \r\n
    " - + ((stack1 = alias1(((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.contents : stack1), depth0)) != null ? stack1 : "") - + "
    \r\n
    "
    -    + ((stack1 = alias1(((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.code : stack1), depth0)) != null ? stack1 : "")
    -    + "
    \r\n
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { + return ( + "\r\n" + + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "content", + { + name: "content", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "\r\n" + ); + }, + 2: function (container, depth0, helpers, partials, data) { + var stack1, + alias1 = container.lambda; + + return ( + '
    \r\n
    ' + + ((stack1 = alias1( + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.contents : stack1, + depth0 + )) != null + ? stack1 + : "") + + '
    \r\n
    ' +
    +      ((stack1 = alias1((stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.code : stack1, depth0)) !=
    +      null
    +        ? stack1
    +        : "") +
    +      "
    \r\n
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { return " line-numbers"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { var stack1; - return "\r\n" - + ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"site/layout",{"name":"extend","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ""; -},"useData":true}); - -this["tmpl"]["tutorial"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) { + return ( + "\r\n" + + ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "site/layout", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "" + ); + }, + useData: true, +}); + +this["tmpl"]["tutorial"] = Handlebars.template({ + 1: function (container, depth0, helpers, partials, data) { var stack1; - return "\r\n" - + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"content",{"name":"content","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "\r\n"; -},"2":function(container,depth0,helpers,partials,data) { + return ( + "\r\n" + + ((stack1 = (helpers.content || (depth0 && depth0.content) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "content", + { + name: "content", + hash: {}, + fn: container.program(2, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "\r\n" + ); + }, + 2: function (container, depth0, helpers, partials, data) { var stack1; - return "
    \r\n
    " - + ((stack1 = container.lambda(((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.contents : stack1), depth0)) != null ? stack1 : "") - + "
    \r\n" - + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.children : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n"; -},"3":function(container,depth0,helpers,partials,data) { + return ( + '
    \r\n
    ' + + ((stack1 = container.lambda( + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.contents : stack1, + depth0 + )) != null + ? stack1 + : "") + + "
    \r\n" + + ((stack1 = helpers["if"].call( + depth0 != null ? depth0 : container.nullContext || {}, + (stack1 = depth0 != null ? depth0.doclet : depth0) != null ? stack1.children : stack1, + { + name: "if", + hash: {}, + fn: container.program(3, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "
    \r\n" + ); + }, + 3: function (container, depth0, helpers, partials, data) { var stack1; - return "
    \r\n

    Related Tutorials

    \r\n
      \r\n" - + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? depth0.doclet : depth0)) != null ? stack1.children : stack1),{"name":"each","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \r\n
    \r\n"; -},"4":function(container,depth0,helpers,partials,data) { - return "
  • " - + container.escapeExpression((helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.longname : depth0),{"name":"linkto","hash":{},"data":data})) - + "
  • \r\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + return ( + ' \r\n" + ); + }, + 4: function (container, depth0, helpers, partials, data) { + return ( + "
  • " + + container.escapeExpression( + (helpers.linkto || (depth0 && depth0.linkto) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + depth0 != null ? depth0.longname : depth0, + { name: "linkto", hash: {}, data: data } + ) + ) + + "
  • \r\n" + ); + }, + compiler: [7, ">= 4.0.0"], + main: function (container, depth0, helpers, partials, data) { var stack1; - return "\r\n" - + ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"site/layout",{"name":"extend","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + ""; -},"useData":true}); - -if (typeof exports === 'object' && exports) {module.exports = this["tmpl"];} \ No newline at end of file + return ( + "\r\n" + + ((stack1 = (helpers.extend || (depth0 && depth0.extend) || helpers.helperMissing).call( + depth0 != null ? depth0 : container.nullContext || {}, + "site/layout", + { + name: "extend", + hash: {}, + fn: container.program(1, data, 0), + inverse: container.noop, + data: data, + } + )) != null + ? stack1 + : "") + + "" + ); + }, + useData: true, +}); + +if (typeof exports === "object" && exports) { + module.exports = this["tmpl"]; +} diff --git a/__DOCS__/JSDocTemplate/template/utils/docletHelper.js b/__DOCS__/JSDocTemplate/template/utils/docletHelper.js index 75f2ac8..6d1bb13 100644 --- a/__DOCS__/JSDocTemplate/template/utils/docletHelper.js +++ b/__DOCS__/JSDocTemplate/template/utils/docletHelper.js @@ -1,387 +1,463 @@ -var template = require('./template'); -var helper = require('jsdoc/util/templateHelper'); -var markdown = require('jsdoc/util/markdown').getParser(); - -var supportsParams = function (doclet) { - return doclet.kind === 'function' || doclet.kind === 'class' || (doclet.kind === 'typedef' && !!doclet.type && !!doclet.type.names && doclet.type.names.some(function (name) { - return name.toLowerCase() === 'function'; - })); -}; - -var getLinkText = exports.getLinkText = function(doclet){ - var text = doclet.longname; - if (["class", "module", "namespace", "mixin", "interface", "event"].indexOf(doclet.kind) !== -1) { - text = text.replace("module:", ""); - if ("event" === doclet.kind) { - text = text.replace("event:", ""); - } - if ("module" === doclet.kind){ - text = text.split('>').pop(); - } - } else if ("external" === doclet.kind) { - text = doclet.name.replace(/(^"|"$)/g, ""); - } else if ("tutorial" === doclet.kind || "readme" === doclet.kind || "list" === doclet.kind) { - text = doclet.title || doclet.name; - } - return text; -}; - -exports.getAttribs = function (doclet) { - if (supportsParams(doclet) || doclet.kind === 'member' || doclet.kind === 'constant') { - var attribs = helper.getAttribs(doclet); - return attribs.length ? '' + helper.htmlsafe('<' + attribs.join(', ') + '> ') + '' : ''; - } - return ''; -}; - -exports.getSignature = function (doclet) { - var signature = ''; - if (supportsParams(doclet)) { - signature += '('; - if (doclet.params && doclet.params.length) { - signature += ' '; - - var optionalClose = []; - doclet.params.forEach(function (p, i) { - if (p.name && p.name.indexOf('.') === -1) { - if (!p.optional && optionalClose.length){ - signature += optionalClose.pop(); - } - var name = '' + (p.variable ? '...' + p.name : p.name) + '', - separator = i > 0 ? (p.optional ? ' [, ' : ', ') : (p.optional ? '[ ' : ''); - signature += separator + name; - if (p.optional) optionalClose.push(' ]'); - } - }); - - signature += optionalClose.join('') + ' '; - } - signature += ')'; - if (template.options.methodHeadingReturns) { - var returnTypes = helper.getSignatureReturns(doclet); - signature += '' + (returnTypes.length ? ' → {' + returnTypes.join('|') + '}' : '') + ''; - } - } else if (doclet.kind === 'member' || doclet.kind === 'constant') { - var types = helper.getSignatureTypes(doclet); - signature += '' + (types.length ? ' :' + types.join('|') : '') + ''; - //todo: check if this is required - //doclet.kind = 'member'; - } - return signature; -}; - -exports.getExamples = function (doclet) { - if (!doclet.examples || !doclet.examples.length) return []; - return doclet.examples.map(function (example) { - // perform parsing of the example content to extract custom inner tags - // create a new example object to return as the result of the mapping - var result = { - caption: '', - code: '', - lang: 'javascript', - run: false - }; - - // parse caption supplied using the default syntax - if (example.match(/^\s*?([\s\S]+?)<\/caption>(\s*)([\s\S]+?)$/i)) { - example = RegExp.$3; - result.caption = markdown(RegExp.$1); - } - - // parse caption supplied using the {@caption } inner tag - var caption = /^\s*?\{@caption\s(.*?)}\s*?/.exec(example); - if (caption && caption[1]) { - example = example.replace(caption[0], ""); - result.caption = markdown(caption[1]); // parse markdown and set result value - } - // parse lang supplied using the {@lang } inner tag, this should be a prism.js supported language to get syntax highlighting. - var lang = /\s*?\{@lang\s(.*?)}\s*?/.exec(example); - if (lang && lang[1]) { - example = example.replace(lang[0], ""); - result.lang = lang[1]; - } - // parse run supplied using the {@run } inner tag, this allows the example to be executed with any console.log calls being piped into a textarea. - // NOTE: if lang !== 'javascript' the {@run} inner tag is simply removed from the example code, we only support running javascript. - var run = /\s*?\{@run\s(.*?)}\s*?/.exec(example); - if (run && run[1]) { - example = example.replace(run[0], ""); - // if the run tag is supplied it is always true regardless of the value so just test if the lang is javascript and use that value - result.run = result.lang === 'javascript'; - } - // the example should now contain just the code - result.code = example; - return result; - }); -}; - -var expandLongnames = function(longnames, parent){ - var results = []; - var generated = template.kinds.pages.indexOf(parent.kind) !== -1; - var memberof = generated ? parent.longname : parent.memberof; - var leftovers = longnames.slice(); - template.find({longname: longnames}).forEach(function(doclet){ - var linkText = getLinkText(doclet); - if (doclet.memberof === memberof){ - linkText = linkText.split("~").pop(); - } - leftovers.splice(leftovers.indexOf(doclet.longname), 1); - results.push({ - link: template.linkto(doclet.longname, linkText), - summary: doclet.summary - }); - }); - leftovers.forEach(function(longname){ - results.push({ - link: template.linkto(longname), - summary: '' - }); - }); - return results; -}; - -exports.getFires = function(doclet){ - if (!doclet.fires) return []; - return expandLongnames(doclet.fires, doclet); -}; - -exports.getRequires = function(doclet){ - if (!doclet.requires) return []; - return expandLongnames(doclet.requires, doclet); -}; - -exports.getSummary = function (doclet) { - if (!doclet.summary) return ''; - return markdown(doclet.summary); -}; - -exports.getParamsOrProps = function (doclet, type) { - if (!doclet[type] || !doclet[type].length) return []; - var sorted = {}; - sorted[type] = []; - doclet[type].forEach(function(paramOrProp){ - if (!paramOrProp) { return; } - var parts = paramOrProp.name.split("."), last = parts.length - 1, base = sorted, parentName = []; - parts.forEach(function(part, i){ - var index; - if (i === last){ - paramOrProp.name = paramOrProp.name.replace(parentName.join('.'), '').replace(/^\./, ''); - base[type] = base[type] || []; - base[type].push(paramOrProp); - } else if ((index = base[type].findIndex(function(p){ return p.name === part; })) !== -1) { - base = base[type][index]; - parentName.push(part); - } - }); - }); - - return sorted[type].filter(function (paramOrProp) { - return !!paramOrProp; - }); -}; - -var checkParamsOrProps = exports.checkParamsOrProps = function (parent, type) { - if (!parent || !parent[type] || !parent[type].length) return; - /* determine if we need extra columns, "attributes" and "default" */ - parent[type + 'HasAttributes'] = false; - parent[type + 'HasDefaults'] = false; - parent[type + 'HasNames'] = false; - - parent[type].forEach(function (paramOrProp) { - if (!paramOrProp) { - return; - } - if (paramOrProp.optional || paramOrProp.nullable || paramOrProp.variable) { - parent[type + 'HasAttributes'] = true; - } - if (paramOrProp.name) { - parent[type + 'HasNames'] = true; - } - if (typeof paramOrProp.defaultvalue !== 'undefined') { - parent[type + 'HasDefaults'] = true; - } - if (paramOrProp[type]) { - checkParamsOrProps(paramOrProp, type); - } - }); -}; - -exports.getPageTitle = function(doclet, sanitized){ - var parts = []; - if (doclet.attribs){ - parts.push(doclet.attribs); - } - if (template.kinds.pages.indexOf(doclet.kind) !== -1 && template.kinds.custom.indexOf(doclet.kind) === -1 && doclet.ancestors && doclet.ancestors.length){ - parts.push(''+doclet.ancestors.join('')+''); - } - if (doclet.title){ - parts.push('' + doclet.title + ''); - } else if (doclet.name) { - var name = doclet.name; - if (doclet.exported){ - name = name.replace('module:', '(require("') + '"))'; - } - parts.push('' + name + ''); - } - if (template.kinds.pages.indexOf(doclet.kind) === -1 && doclet.signature){ - parts.push(doclet.signature); - } - if (doclet.variation){ - parts.push('' + doclet.variation + ''); - } - var result = parts.join(''); - return sanitized ? template.sanitize(result) : result; -}; - -exports.getListTitle = function(doclet, sanitized){ - var parts = [], linkClose = false, url = doclet.kind === 'tutorial' ? helper.tutorialToUrl(doclet.longname) : helper.longnameToUrl[doclet.longname]; - // only generate links to kinds that have a page generated, others show content inline so there's no need - if (url){ - parts.push(''); - linkClose = true; - } - if (doclet.kind === 'class'){ - parts.push('new '); - } - if (doclet.ancestors && doclet.ancestors.length){ - parts.push(''+template.sanitize(doclet.ancestors.join(''))+''); - } - if (doclet.attribs){ - parts.push(doclet.attribs); - } - if (doclet.title){ - parts.push('' + doclet.title + ''); - } else if (doclet.name) { - var name = doclet.name; - if (doclet.exported){ - name = name.replace('module:', '(require("') + '"))'; - } - parts.push('' + name + ''); - } - if (doclet.signature){ - parts.push(doclet.signature); - } - if (doclet.variation){ - parts.push('' + doclet.variation + ''); - } - if (linkClose){ - parts.push(''); - } - var result = parts.join(''); - return sanitized ? template.sanitize(result) : result; -}; - -exports.getSymbolTitle = function(doclet, sanitized){ - var parts = [], linkClose = false, url = doclet.kind === 'tutorial' ? helper.tutorialToUrl(doclet.longname) : helper.longnameToUrl[doclet.longname]; - // only generate links to kinds that have a page generated, others show content inline so there's no need - if (template.kinds.pages.indexOf(doclet.kind) !== -1 && url){ - parts.push(''); - linkClose = true; - } - if (doclet.kind === 'class'){ - parts.push('new '); - } - if (doclet.attribs){ - parts.push(doclet.attribs); - } - if (doclet.title){ - parts.push('' + doclet.title + ''); - } else if (doclet.name) { - var name = doclet.name; - if (doclet.exported){ - name = name.replace('module:', '(require("') + '"))'; - } - parts.push('' + name + ''); - } - if (doclet.signature){ - parts.push(doclet.signature); - } - if (doclet.variation){ - parts.push('' + doclet.variation + ''); - } - if (linkClose){ - parts.push(''); - } - var result = parts.join(''); - return sanitized ? template.sanitize(result) : result; -}; - -exports.getPrimaryTitle = function(doclet, sanitized){ - var parts = []; - if (doclet.kind === 'class'){ - parts.push('new '); - } - if (doclet.attribs){ - parts.push(doclet.attribs); - } - if (doclet.title){ - parts.push('' + doclet.title + ''); - } else if (doclet.name) { - var name = doclet.name; - if (doclet.exported){ - name = name.replace('module:', '(require("') + '"))'; - } - parts.push('' + doclet.name + ''); - } - if (doclet.signature){ - parts.push(doclet.signature); - } - if (doclet.variation){ - parts.push('' + doclet.variation + ''); - } - var result = parts.join(''); - return sanitized ? template.sanitize(result) : result; -}; - -exports.getSymbols = function(doclet){ - var symbols = {}; - if (doclet.longname == helper.globalName){ - template.kinds.global.forEach(function(kind){ - symbols[kind] = template.find({kind: kind, memberof: { isUndefined: true }}); - }); - } else { - template.kinds.symbols.forEach(function(kind){ - symbols[kind] = template.find({kind: kind, memberof: doclet.longname}); - }); - } - return symbols; -}; - -exports.getShowAccessFilter = function(doclet){ - var result = typeof doclet.showAccessFilter != 'boolean' ? template.options.showAccessFilter : doclet.showAccessFilter; - if (result){ - // if we can show the filter check if we should actually show it - doclet.has = { - inherited: template.find({kind: template.kinds.symbols, memberof: doclet.longname, inherited: true}).length > 0, - public: template.find({kind: template.kinds.symbols, memberof: doclet.longname, access: "public"}).length > 0, - protected: template.find({kind: template.kinds.symbols, memberof: doclet.longname, access: "protected"}).length > 0, - private: template.find({kind: template.kinds.symbols, memberof: doclet.longname, access: "private"}).length > 0 - }; - var count = (doclet.has.inherited ? 1 : 0) + (doclet.has.public ? 1 : 0) + (doclet.has.protected ? 1 : 0) + (doclet.has.private ? 1 : 0); - // only show the filter if there are two or more accessors available - result = count > 1; - } - return result; -}; - -exports.isInherited = function(doclet){ - return !!doclet.inherited; -}; - -exports.hasDetails = function (doclet) { - return !!(doclet.version - || doclet.since - || (doclet.inherited && doclet.inherits) - || doclet.since - || (doclet.implementations && doclet.implementations.length) - || (doclet.implements && doclet.implements.length) - || (doclet.mixes && doclet.mixes.length) - || doclet.deprecated - || (doclet.author && doclet.author.length) - || doclet.copyright - || doclet.license - || doclet.defaultvalue - || doclet.hasSource - || (doclet.tutorials && doclet.tutorials.length) - || (doclet.see && doclet.see.length) - || (doclet.todo && doclet.todo.length)) -}; +var template = require("./template"); +var helper = require("jsdoc/util/templateHelper"); +var markdown = require("jsdoc/util/markdown").getParser(); + +var supportsParams = function (doclet) { + return ( + doclet.kind === "function" || + doclet.kind === "class" || + (doclet.kind === "typedef" && + !!doclet.type && + !!doclet.type.names && + doclet.type.names.some(function (name) { + return name.toLowerCase() === "function"; + })) + ); +}; + +var getLinkText = (exports.getLinkText = function (doclet) { + var text = doclet.longname; + if (["class", "module", "namespace", "mixin", "interface", "event"].indexOf(doclet.kind) !== -1) { + text = text.replace("module:", ""); + if ("event" === doclet.kind) { + text = text.replace("event:", ""); + } + if ("module" === doclet.kind) { + text = text.split(">").pop(); + } + } else if ("external" === doclet.kind) { + text = doclet.name.replace(/(^"|"$)/g, ""); + } else if ("tutorial" === doclet.kind || "readme" === doclet.kind || "list" === doclet.kind) { + text = doclet.title || doclet.name; + } + return text; +}); + +exports.getAttribs = function (doclet) { + if (supportsParams(doclet) || doclet.kind === "member" || doclet.kind === "constant") { + var attribs = helper.getAttribs(doclet); + return attribs.length + ? '' + helper.htmlsafe("<" + attribs.join(", ") + "> ") + "" + : ""; + } + return ""; +}; + +exports.getSignature = function (doclet) { + var signature = ""; + if (supportsParams(doclet)) { + signature += '('; + if (doclet.params && doclet.params.length) { + signature += " "; + + var optionalClose = []; + doclet.params.forEach(function (p, i) { + if (p.name && p.name.indexOf(".") === -1) { + if (!p.optional && optionalClose.length) { + signature += optionalClose.pop(); + } + var name = '' + (p.variable ? "..." + p.name : p.name) + "", + separator = i > 0 ? (p.optional ? " [, " : ", ") : p.optional ? "[ " : ""; + signature += separator + name; + if (p.optional) optionalClose.push(" ]"); + } + }); + + signature += optionalClose.join("") + " "; + } + signature += ")"; + if (template.options.methodHeadingReturns) { + var returnTypes = helper.getSignatureReturns(doclet); + signature += + '' + + (returnTypes.length ? " → {" + returnTypes.join("|") + "}" : "") + + ""; + } + } else if (doclet.kind === "member" || doclet.kind === "constant") { + var types = helper.getSignatureTypes(doclet); + signature += '' + (types.length ? " :" + types.join("|") : "") + ""; + //todo: check if this is required + //doclet.kind = 'member'; + } + return signature; +}; + +exports.getExamples = function (doclet) { + if (!doclet.examples || !doclet.examples.length) return []; + return doclet.examples.map(function (example) { + // perform parsing of the example content to extract custom inner tags + // create a new example object to return as the result of the mapping + var result = { + caption: "", + code: "", + lang: "javascript", + run: false, + }; + + // parse caption supplied using the default syntax + if (example.match(/^\s*?([\s\S]+?)<\/caption>(\s*)([\s\S]+?)$/i)) { + example = RegExp.$3; + result.caption = markdown(RegExp.$1); + } + + // parse caption supplied using the {@caption } inner tag + var caption = /^\s*?\{@caption\s(.*?)}\s*?/.exec(example); + if (caption && caption[1]) { + example = example.replace(caption[0], ""); + result.caption = markdown(caption[1]); // parse markdown and set result value + } + // parse lang supplied using the {@lang } inner tag, this should be a prism.js supported language to get syntax highlighting. + var lang = /\s*?\{@lang\s(.*?)}\s*?/.exec(example); + if (lang && lang[1]) { + example = example.replace(lang[0], ""); + result.lang = lang[1]; + } + // parse run supplied using the {@run } inner tag, this allows the example to be executed with any console.log calls being piped into a textarea. + // NOTE: if lang !== 'javascript' the {@run} inner tag is simply removed from the example code, we only support running javascript. + var run = /\s*?\{@run\s(.*?)}\s*?/.exec(example); + if (run && run[1]) { + example = example.replace(run[0], ""); + // if the run tag is supplied it is always true regardless of the value so just test if the lang is javascript and use that value + result.run = result.lang === "javascript"; + } + // the example should now contain just the code + result.code = example; + return result; + }); +}; + +var expandLongnames = function (longnames, parent) { + var results = []; + var generated = template.kinds.pages.indexOf(parent.kind) !== -1; + var memberof = generated ? parent.longname : parent.memberof; + var leftovers = longnames.slice(); + template.find({ longname: longnames }).forEach(function (doclet) { + var linkText = getLinkText(doclet); + if (doclet.memberof === memberof) { + linkText = linkText.split("~").pop(); + } + leftovers.splice(leftovers.indexOf(doclet.longname), 1); + results.push({ + link: template.linkto(doclet.longname, linkText), + summary: doclet.summary, + }); + }); + leftovers.forEach(function (longname) { + results.push({ + link: template.linkto(longname), + summary: "", + }); + }); + return results; +}; + +exports.getFires = function (doclet) { + if (!doclet.fires) return []; + return expandLongnames(doclet.fires, doclet); +}; + +exports.getRequires = function (doclet) { + if (!doclet.requires) return []; + return expandLongnames(doclet.requires, doclet); +}; + +exports.getSummary = function (doclet) { + if (!doclet.summary) return ""; + return markdown(doclet.summary); +}; + +exports.getParamsOrProps = function (doclet, type) { + if (!doclet[type] || !doclet[type].length) return []; + var sorted = {}; + sorted[type] = []; + doclet[type].forEach(function (paramOrProp) { + if (!paramOrProp) { + return; + } + var parts = paramOrProp.name.split("."), + last = parts.length - 1, + base = sorted, + parentName = []; + parts.forEach(function (part, i) { + var index; + if (i === last) { + paramOrProp.name = paramOrProp.name.replace(parentName.join("."), "").replace(/^\./, ""); + base[type] = base[type] || []; + base[type].push(paramOrProp); + } else if ( + (index = base[type].findIndex(function (p) { + return p.name === part; + })) !== -1 + ) { + base = base[type][index]; + parentName.push(part); + } + }); + }); + + return sorted[type].filter(function (paramOrProp) { + return !!paramOrProp; + }); +}; + +var checkParamsOrProps = (exports.checkParamsOrProps = function (parent, type) { + if (!parent || !parent[type] || !parent[type].length) return; + /* determine if we need extra columns, "attributes" and "default" */ + parent[type + "HasAttributes"] = false; + parent[type + "HasDefaults"] = false; + parent[type + "HasNames"] = false; + + parent[type].forEach(function (paramOrProp) { + if (!paramOrProp) { + return; + } + if (paramOrProp.optional || paramOrProp.nullable || paramOrProp.variable) { + parent[type + "HasAttributes"] = true; + } + if (paramOrProp.name) { + parent[type + "HasNames"] = true; + } + if (typeof paramOrProp.defaultvalue !== "undefined") { + parent[type + "HasDefaults"] = true; + } + if (paramOrProp[type]) { + checkParamsOrProps(paramOrProp, type); + } + }); +}); + +exports.getPageTitle = function (doclet, sanitized) { + var parts = []; + if (doclet.attribs) { + parts.push(doclet.attribs); + } + if ( + template.kinds.pages.indexOf(doclet.kind) !== -1 && + template.kinds.custom.indexOf(doclet.kind) === -1 && + doclet.ancestors && + doclet.ancestors.length + ) { + parts.push('' + doclet.ancestors.join("") + ""); + } + if (doclet.title) { + parts.push('' + doclet.title + ""); + } else if (doclet.name) { + var name = doclet.name; + if (doclet.exported) { + name = + name.replace( + "module:", + '(require("' + ) + '"))'; + } + parts.push('' + name + ""); + } + if (template.kinds.pages.indexOf(doclet.kind) === -1 && doclet.signature) { + parts.push(doclet.signature); + } + if (doclet.variation) { + parts.push('' + doclet.variation + ""); + } + var result = parts.join(""); + return sanitized ? template.sanitize(result) : result; +}; + +exports.getListTitle = function (doclet, sanitized) { + var parts = [], + linkClose = false, + url = doclet.kind === "tutorial" ? helper.tutorialToUrl(doclet.longname) : helper.longnameToUrl[doclet.longname]; + // only generate links to kinds that have a page generated, others show content inline so there's no need + if (url) { + parts.push(''); + linkClose = true; + } + if (doclet.kind === "class") { + parts.push('new '); + } + if (doclet.ancestors && doclet.ancestors.length) { + parts.push('' + template.sanitize(doclet.ancestors.join("")) + ""); + } + if (doclet.attribs) { + parts.push(doclet.attribs); + } + if (doclet.title) { + parts.push('' + doclet.title + ""); + } else if (doclet.name) { + var name = doclet.name; + if (doclet.exported) { + name = + name.replace( + "module:", + '(require("' + ) + '"))'; + } + parts.push('' + name + ""); + } + if (doclet.signature) { + parts.push(doclet.signature); + } + if (doclet.variation) { + parts.push('' + doclet.variation + ""); + } + if (linkClose) { + parts.push(""); + } + var result = parts.join(""); + return sanitized ? template.sanitize(result) : result; +}; + +exports.getSymbolTitle = function (doclet, sanitized) { + var parts = [], + linkClose = false, + url = doclet.kind === "tutorial" ? helper.tutorialToUrl(doclet.longname) : helper.longnameToUrl[doclet.longname]; + // only generate links to kinds that have a page generated, others show content inline so there's no need + if (template.kinds.pages.indexOf(doclet.kind) !== -1 && url) { + parts.push(''); + linkClose = true; + } + if (doclet.kind === "class") { + parts.push('new '); + } + if (doclet.attribs) { + parts.push(doclet.attribs); + } + if (doclet.title) { + parts.push('' + doclet.title + ""); + } else if (doclet.name) { + var name = doclet.name; + if (doclet.exported) { + name = + name.replace( + "module:", + '(require("' + ) + '"))'; + } + parts.push('' + name + ""); + } + if (doclet.signature) { + parts.push(doclet.signature); + } + if (doclet.variation) { + parts.push('' + doclet.variation + ""); + } + if (linkClose) { + parts.push(""); + } + var result = parts.join(""); + return sanitized ? template.sanitize(result) : result; +}; + +exports.getPrimaryTitle = function (doclet, sanitized) { + var parts = []; + if (doclet.kind === "class") { + parts.push('new '); + } + if (doclet.attribs) { + parts.push(doclet.attribs); + } + if (doclet.title) { + parts.push('' + doclet.title + ""); + } else if (doclet.name) { + var name = doclet.name; + if (doclet.exported) { + name = + name.replace( + "module:", + '(require("' + ) + '"))'; + } + parts.push('' + doclet.name + ""); + } + if (doclet.signature) { + parts.push(doclet.signature); + } + if (doclet.variation) { + parts.push('' + doclet.variation + ""); + } + var result = parts.join(""); + return sanitized ? template.sanitize(result) : result; +}; + +exports.getSymbols = function (doclet) { + var symbols = {}; + if (doclet.longname == helper.globalName) { + template.kinds.global.forEach(function (kind) { + symbols[kind] = template.find({ + kind: kind, + memberof: { isUndefined: true }, + }); + }); + } else { + template.kinds.symbols.forEach(function (kind) { + symbols[kind] = template.find({ kind: kind, memberof: doclet.longname }); + }); + } + return symbols; +}; + +exports.getShowAccessFilter = function (doclet) { + var result = + typeof doclet.showAccessFilter != "boolean" ? template.options.showAccessFilter : doclet.showAccessFilter; + if (result) { + // if we can show the filter check if we should actually show it + doclet.has = { + inherited: + template.find({ + kind: template.kinds.symbols, + memberof: doclet.longname, + inherited: true, + }).length > 0, + public: + template.find({ + kind: template.kinds.symbols, + memberof: doclet.longname, + access: "public", + }).length > 0, + protected: + template.find({ + kind: template.kinds.symbols, + memberof: doclet.longname, + access: "protected", + }).length > 0, + private: + template.find({ + kind: template.kinds.symbols, + memberof: doclet.longname, + access: "private", + }).length > 0, + }; + var count = + (doclet.has.inherited ? 1 : 0) + + (doclet.has.public ? 1 : 0) + + (doclet.has.protected ? 1 : 0) + + (doclet.has.private ? 1 : 0); + // only show the filter if there are two or more accessors available + result = count > 1; + } + return result; +}; + +exports.isInherited = function (doclet) { + return !!doclet.inherited; +}; + +exports.hasDetails = function (doclet) { + return !!( + doclet.version || + doclet.since || + (doclet.inherited && doclet.inherits) || + doclet.since || + (doclet.implementations && doclet.implementations.length) || + (doclet.implements && doclet.implements.length) || + (doclet.mixes && doclet.mixes.length) || + doclet.deprecated || + (doclet.author && doclet.author.length) || + doclet.copyright || + doclet.license || + doclet.defaultvalue || + doclet.hasSource || + (doclet.tutorials && doclet.tutorials.length) || + (doclet.see && doclet.see.length) || + (doclet.todo && doclet.todo.length) + ); +}; diff --git a/__DOCS__/JSDocTemplate/template/utils/handlebarsHelper.js b/__DOCS__/JSDocTemplate/template/utils/handlebarsHelper.js index 334ee02..305dd0b 100644 --- a/__DOCS__/JSDocTemplate/template/utils/handlebarsHelper.js +++ b/__DOCS__/JSDocTemplate/template/utils/handlebarsHelper.js @@ -1,99 +1,100 @@ -var helper = require('jsdoc/util/templateHelper'); -var template = require('./template'); -var handlebars = require('handlebars'); -// require and register the layout helpers for handlebars -require('handlebars-layouts').register(handlebars); -var tmpl = exports.tmpl = require('../tmpl'); - -exports.render = function(doclet, resolveLinks){ - var tmp = tmpl.doclet; - if (tmpl[doclet.kind]){ - tmp = tmpl[doclet.kind]; - } - var html = tmp({ - crumbs: template.createCrumbs(doclet), - doclet: doclet, - config: template.config, - options: template.options, - navbar: template.navbar - }); - if (resolveLinks){ - html = helper.resolveLinks(html); - } - return html; -}; - -handlebars.registerHelper("json", function(context, options){ - try { - return !!options.hash.pretty ? JSON.stringify(context, null, 2) : JSON.stringify(context); - } catch(err) { - return err.message; - } -}); - -handlebars.registerHelper("now", function(context, options){ - return Date.now(); -}); - -handlebars.registerHelper("symbol", function(doclet, options){ - var result = "", kind = doclet.kind; - if (kind === 'class' && options.hash.primary){ - kind = 'function'; - } - if (tmpl['symbol/'+kind]){ - result = tmpl['symbol/'+kind](doclet, {data: options.hash}); - } else if (template.kinds.pages.indexOf(kind) !== -1 && !options.hash.primary) { - result = tmpl['symbol/page'](doclet, {data: options.hash}); - } else { - result = tmpl['symbol/inline'](doclet, {data: options.hash}); - } - return new handlebars.SafeString(result); -}); - -handlebars.registerHelper("type-names", function(type){ - var result = ""; - if (type && type.names && type.names.length){ - type.names.forEach(function(name, i){ - if (i > 0) result += ' | '; - result += ''+helper.linkto(name, helper.htmlsafe(name))+''; - }); - } - return new handlebars.SafeString(result); -}); - -handlebars.registerHelper("param-attribs", function(param){ - var result = ""; - if (param){ - if (param.optional){ - result += '<optional>
    ' - } - if (param.nullable){ - result += '<nullable>
    ' - } - if (param.variable){ - result += '<repeatable>
    ' - } - } - return new handlebars.SafeString(result); -}); - -handlebars.registerHelper("callout", function(title, classes, options){ - title = typeof title === 'string' ? title : ''; - classes = typeof classes === 'string' ? classes : 'callout-default'; - var result = '
    '; - result += '
    '+title+'
    '; - result += options.fn(this); - return result + '
    '; -}); - -handlebars.registerHelper("single", function(array, options){ - if (!array || !array.length) return ""; - if (array.length === 1){ - return options.fn(array[0]); - } - return options.inverse(this); -}); - -handlebars.registerHelper("linkto", function(longname){ - return new handlebars.SafeString(template.linkto(longname)); -}); +var helper = require("jsdoc/util/templateHelper"); +var template = require("./template"); +var handlebars = require("handlebars"); +// require and register the layout helpers for handlebars +require("handlebars-layouts").register(handlebars); +var tmpl = (exports.tmpl = require("../tmpl")); + +exports.render = function (doclet, resolveLinks) { + var tmp = tmpl.doclet; + if (tmpl[doclet.kind]) { + tmp = tmpl[doclet.kind]; + } + var html = tmp({ + crumbs: template.createCrumbs(doclet), + doclet: doclet, + config: template.config, + options: template.options, + navbar: template.navbar, + }); + if (resolveLinks) { + html = helper.resolveLinks(html); + } + return html; +}; + +handlebars.registerHelper("json", function (context, options) { + try { + return !!options.hash.pretty ? JSON.stringify(context, null, 2) : JSON.stringify(context); + } catch (err) { + return err.message; + } +}); + +handlebars.registerHelper("now", function (context, options) { + return Date.now(); +}); + +handlebars.registerHelper("symbol", function (doclet, options) { + var result = "", + kind = doclet.kind; + if (kind === "class" && options.hash.primary) { + kind = "function"; + } + if (tmpl["symbol/" + kind]) { + result = tmpl["symbol/" + kind](doclet, { data: options.hash }); + } else if (template.kinds.pages.indexOf(kind) !== -1 && !options.hash.primary) { + result = tmpl["symbol/page"](doclet, { data: options.hash }); + } else { + result = tmpl["symbol/inline"](doclet, { data: options.hash }); + } + return new handlebars.SafeString(result); +}); + +handlebars.registerHelper("type-names", function (type) { + var result = ""; + if (type && type.names && type.names.length) { + type.names.forEach(function (name, i) { + if (i > 0) result += " | "; + result += '' + helper.linkto(name, helper.htmlsafe(name)) + ""; + }); + } + return new handlebars.SafeString(result); +}); + +handlebars.registerHelper("param-attribs", function (param) { + var result = ""; + if (param) { + if (param.optional) { + result += "<optional>
    "; + } + if (param.nullable) { + result += "<nullable>
    "; + } + if (param.variable) { + result += "<repeatable>
    "; + } + } + return new handlebars.SafeString(result); +}); + +handlebars.registerHelper("callout", function (title, classes, options) { + title = typeof title === "string" ? title : ""; + classes = typeof classes === "string" ? classes : "callout-default"; + var result = '
    '; + result += "
    " + title + "
    "; + result += options.fn(this); + return result + "
    "; +}); + +handlebars.registerHelper("single", function (array, options) { + if (!array || !array.length) return ""; + if (array.length === 1) { + return options.fn(array[0]); + } + return options.inverse(this); +}); + +handlebars.registerHelper("linkto", function (longname) { + return new handlebars.SafeString(template.linkto(longname)); +}); diff --git a/__DOCS__/JSDocTemplate/template/utils/lunrHelper.js b/__DOCS__/JSDocTemplate/template/utils/lunrHelper.js index 82db1cc..d8c75d0 100644 --- a/__DOCS__/JSDocTemplate/template/utils/lunrHelper.js +++ b/__DOCS__/JSDocTemplate/template/utils/lunrHelper.js @@ -1,94 +1,96 @@ -var lunr = require('lunr'), - cheerio = require('cheerio'), - template = require('./template'), - sanitizeHtml = require('sanitize-html'), - path = require('jsdoc/path'), - fs = require('jsdoc/fs'), - helper = require('jsdoc/util/templateHelper'); - -var store = exports.store = {}; -var index = exports.index = lunr(function () { - this.field('tags', {boost: 1000}); - this.field('name', {boost: 5}); - // this.field('id', {boost: 300}); - // this.field('kind', {boost: 10}); - // this.field('title', {boost: 100}); - this.field('summary', {boost: 20}); - // this.field('description', {boost: 50}); - // this.field('body'); - this.ref('id'); -}); - -var sanitize = function (html) { - if (typeof html !== 'string') return void 0; - return sanitizeHtml(html, {allowedTags: [], allowedAttributes: []}).replace(/\s+/g, ' ').trim(); -}; - -var _variations = function (parts) { - var result = []; - result.push(parts.join('.')); - if (parts.length > 1) { - parts.shift(); - result.push(_variations(parts)); - } else if (parts.length === 1) { - var instance = parts[0].indexOf('#'); - if (instance !== -1) { - result.push(parts[0].substr(instance + 1)); - } - } - return result.join(' '); -}; - -var variations = function (longname) { - if (typeof longname != 'string' || longname === '') return ''; - return _variations(longname.split('.')); -}; - -var tags = function (doclet) { - var result = []; - if (doclet.longname && doclet.longname !== '') { - result.push(variations(doclet.longname)); - } - return result.join(' '); -}; - -var parseBody = function (html) { - if (!html || typeof html !== 'string') return; - var $ = cheerio.load(html); - return $('#main').text().replace(/\s+/g, ' ').trim(); -}; - -var add = exports.add = function (doclet, html) { - var id = helper.longnameToUrl[doclet.longname]; - index.add(store[id] = { - "id": id, - "kind": doclet.kind, - "title": doclet.pageTitle, - "longname": doclet.longname, - "name": doclet.name, - "tags": tags(doclet).split('.').join(' '), - "summary": sanitize(helper.resolveLinks(doclet.summary)), - "description": sanitize(helper.resolveLinks(doclet.classdesc || doclet.description)), - "body": parseBody(html) - }); - if (doclet.kind === 'class' || doclet.kind === 'namespace') { - doclet.symbols.member.forEach(function (member) { - add(member); - }); - doclet.symbols.function.forEach(function (fn) { - add(fn); - }); - doclet.symbols.typedef.forEach(function (typedef) { - add(typedef); - }); - } -}; - -exports.writeFilesSync = function (pretty) { - var jsonFile = path.join(template.config.dir.output, 'js/lunr-data.json'), - dataFile = path.join(template.config.dir.output, 'js/lunr-data.js'), - data = {index: index, store: store}, - json = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data); - fs.writeFileSync(jsonFile, json, "utf8"); - fs.writeFileSync(dataFile, "window.lunrData = " + json + ";", "utf8"); -}; +var lunr = require("lunr"), + cheerio = require("cheerio"), + template = require("./template"), + sanitizeHtml = require("sanitize-html"), + path = require("jsdoc/path"), + fs = require("jsdoc/fs"), + helper = require("jsdoc/util/templateHelper"); + +var store = (exports.store = {}); +var index = (exports.index = lunr(function () { + this.field("tags", { boost: 1000 }); + this.field("name", { boost: 5 }); + // this.field('id', {boost: 300}); + // this.field('kind', {boost: 10}); + // this.field('title', {boost: 100}); + this.field("summary", { boost: 20 }); + // this.field('description', {boost: 50}); + // this.field('body'); + this.ref("id"); +})); + +var sanitize = function (html) { + if (typeof html !== "string") return void 0; + return sanitizeHtml(html, { allowedTags: [], allowedAttributes: [] }).replace(/\s+/g, " ").trim(); +}; + +var _variations = function (parts) { + var result = []; + result.push(parts.join(".")); + if (parts.length > 1) { + parts.shift(); + result.push(_variations(parts)); + } else if (parts.length === 1) { + var instance = parts[0].indexOf("#"); + if (instance !== -1) { + result.push(parts[0].substr(instance + 1)); + } + } + return result.join(" "); +}; + +var variations = function (longname) { + if (typeof longname != "string" || longname === "") return ""; + return _variations(longname.split(".")); +}; + +var tags = function (doclet) { + var result = []; + if (doclet.longname && doclet.longname !== "") { + result.push(variations(doclet.longname)); + } + return result.join(" "); +}; + +var parseBody = function (html) { + if (!html || typeof html !== "string") return; + var $ = cheerio.load(html); + return $("#main").text().replace(/\s+/g, " ").trim(); +}; + +var add = (exports.add = function (doclet, html) { + var id = helper.longnameToUrl[doclet.longname]; + index.add( + (store[id] = { + id: id, + kind: doclet.kind, + title: doclet.pageTitle, + longname: doclet.longname, + name: doclet.name, + tags: tags(doclet).split(".").join(" "), + summary: sanitize(helper.resolveLinks(doclet.summary)), + description: sanitize(helper.resolveLinks(doclet.classdesc || doclet.description)), + body: parseBody(html), + }) + ); + if (doclet.kind === "class" || doclet.kind === "namespace") { + doclet.symbols.member.forEach(function (member) { + add(member); + }); + doclet.symbols.function.forEach(function (fn) { + add(fn); + }); + doclet.symbols.typedef.forEach(function (typedef) { + add(typedef); + }); + } +}); + +exports.writeFilesSync = function (pretty) { + var jsonFile = path.join(template.config.dir.output, "js/lunr-data.json"), + dataFile = path.join(template.config.dir.output, "js/lunr-data.js"), + data = { index: index, store: store }, + json = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data); + fs.writeFileSync(jsonFile, json, "utf8"); + fs.writeFileSync(dataFile, "window.lunrData = " + json + ";", "utf8"); +}; diff --git a/__DOCS__/JSDocTemplate/template/utils/postProcessor.js b/__DOCS__/JSDocTemplate/template/utils/postProcessor.js index 79c35dd..f32327b 100644 --- a/__DOCS__/JSDocTemplate/template/utils/postProcessor.js +++ b/__DOCS__/JSDocTemplate/template/utils/postProcessor.js @@ -1,343 +1,371 @@ -var fs = require('jsdoc/fs'); -var path = require('jsdoc/path'); -var helper = require('jsdoc/util/templateHelper'); -var doop = require('jsdoc/util/doop'); -var handle = require('jsdoc/util/error').handle; -var template = require('./template'); -var doc = require('./docletHelper'); -var glob = require('glob'); -var extend = require('extend'); - -exports.process = function(){ - template.raw.data.sort(template.options.sort); - - template.raw.data().each(function(doclet){ - doclet.ancestors = helper.getAncestorLinks(template.raw.data, doclet); - doclet.linkText = doc.getLinkText(doclet); - doclet.summary = doc.getSummary(doclet); - doclet.params = doc.getParamsOrProps(doclet, 'params'); - doc.checkParamsOrProps(doclet, 'params'); - doclet.properties = doc.getParamsOrProps(doclet, 'properties'); - doc.checkParamsOrProps(doclet, 'properties'); - doclet.attribs = doc.getAttribs(doclet); - doclet.signature = doc.getSignature(doclet); - doclet.examples = doc.getExamples(doclet); - doclet.fires = doc.getFires(doclet); - doclet.requires = doc.getRequires(doclet); - doclet.pageTitle = doc.getPageTitle(doclet, true); - doclet.pageTitleHTML = doc.getPageTitle(doclet, false); - doclet.symbolTitle = doc.getSymbolTitle(doclet, true); - doclet.symbolTitleHTML = doc.getSymbolTitle(doclet, false); - doclet.primaryTitle = doc.getPrimaryTitle(doclet, true); - doclet.primaryTitleHTML = doc.getPrimaryTitle(doclet, false); - doclet.listTitle = doc.getListTitle(doclet, true); - doclet.listTitleHTML = doc.getListTitle(doclet, false); - doclet.hasDetails = doc.hasDetails(doclet); - doclet.inherited = doc.isInherited(doclet); - doclet.access = typeof doclet.access == 'string' ? doclet.access : "public"; - // todo: maybe expose this as an additional option, basically switches the description to a summary if no summary was supplied and the descriptions text is shorter than 120 characters - //if (!doclet.summary.length && doclet.description && template.sanitize(doclet.description).length <= 120){ - // doclet.summary = doclet.description; - // doclet.description = ''; - //} - if (typeof doclet.showTableOfContents != 'boolean'){ - doclet.showTableOfContents = template.options.showTableOfContents; - } - }); - - template.raw.data().each(function(doclet){ - doclet.symbols = doc.getSymbols(doclet); - doclet.showAccessFilter = doc.getShowAccessFilter(doclet); - }); -}; - -var hasOwnProp = Object.prototype.hasOwnProperty; -function getFilename(longname) { - var fileUrl; - if ( hasOwnProp.call(helper.longnameToUrl, longname) ) { - fileUrl = helper.longnameToUrl[longname]; - } else { - fileUrl = helper.getUniqueFilename(longname); - helper.registerLink(longname, fileUrl); - } - return fileUrl; -} - -/** - * @summary Registers the given doclet creating and registering a link for it and appending an id value to use when rendering in HTML. - * @param doclet - The doclet to register. - */ -var registerDoclet = exports.registerDoclet = function (doclet) { - var url; - if (template.kinds.custom.indexOf(doclet.kind) !== -1) { - url = helper.getUniqueFilename(doclet.longname); - } else if (doclet.kind === 'event') { - url = getFilename(doclet.memberof || helper.globalName); - if ( (doclet.name !== doclet.longname) || (doclet.scope === helper.globalName) ) { - url += '#' + (helper.scopeToPunc[doclet.scope] === '#' ? '' : helper.scopeToPunc[doclet.scope]) + 'event:' + doclet.name.replace(/(^"|"$)/g, ""); - } - } else { - url = helper.createLink(doclet); - } - helper.registerLink(doclet.longname, url); - if (helper.longnameToUrl[doclet.longname].indexOf('#') > -1) { - doclet.id = helper.longnameToUrl[doclet.longname].split(/#/).pop(); - } else { - doclet.id = doclet.name; - } -}; - -/** - * @summary Registers the README.md file as the `readme` doclet. - * @description This not only registers the doclet but also the link associated with it, reserving it prior to registering any other links. - * - * The doclet is built up using the `systemName` and `systemSummary` options as the values for the associated `name` and `summary` properties of a doclet. The `longname` is simply the filename which is `index.html` and the `contents` is the markdown parsed `README.md` supplied as a source to jsdoc. - * @example {@caption The following shows the basic structure of the generated doclet.} - * { - * kind: "readme", - * longname: "index.html", - * name: "", - * summary: "", - * contents: "" - * } - */ -exports.registerReadme = function () { - var doclet = { - kind: 'readme', - longname: 'index', - name: template.options.systemName, - summary: template.options.systemSummary, - contents: template.raw.opts.readme - }; - registerDoclet(doclet); - template.raw.data.insert(doclet); -}; - -exports.registerGlobals = function(){ - var options = template.options.navMembers.find(function(member){ return member.kind === "global"; }); - if (!options){ - options = { - title: "Globals", - summary: "All documented globals." - }; - } - var doclet = { - kind: 'global', - longname: helper.globalName, - name: options.title, - summary: options.summary, - members: template.find({ - kind: template.kinds.global, - memberof: { isUndefined: true } - }, "longname, version, since"), - showTableOfContents: true, - showAccessFilter: false - }; - registerDoclet(doclet); - template.raw.data.insert(doclet); -}; - -exports.registerListeners = function(){ - helper.addEventListeners(template.raw.data); -}; - -/** - * @summary Registers all default doclets. - */ -exports.registerDoclets = function(){ - template.raw.data().each(function(doclet){ - if (template.kinds.custom.indexOf(doclet.kind) === -1) { - registerDoclet(doclet); - } - }); -}; - -exports.registerModules = function(){ - var mapping = {}; - template.raw.data({ - kind: ['class', 'function'], - longname: { - left: 'module:' - } - }).each(function(doclet){ - var longname = doclet.longname; - mapping[longname] = mapping[longname] || []; - mapping[longname].push(doclet); - }); - template.raw.data({kind: 'module'}).each(function(module){ - if (mapping[module.longname]){ - mapping[module.longname].filter(function(doclet){ - return doclet.summary || doclet.description || doclet.kind === 'class'; - }).forEach(function(doclet){ - doclet.exported = true; - doclet.memberof = module.longname; - var scope = helper.scopeToPunc[doclet.scope] || '>'; - doclet.longname = module.longname + scope + doclet.name; - }); - } - }); -}; - -/** - * @summary Registers all source files as a `source` doclet. - * @description This method takes into account the `sourceRootPath` option and will remove this value from the file path when generating the `longname` value for the doclet. If this option is not supplied the default behavior is to find the common prefix of all file paths and trim that. - */ -exports.registerSources = function () { - var sourceFilePaths = []; - // iterate all default doclets and build the source file path if the file meta exists and add it to the doclet as meta.filepath - template.raw.data().each(function (doclet) { - if (template.kinds.custom.indexOf(doclet.kind) === -1) { - if (doclet.meta) { - var src = doclet.meta.path && doclet.meta.path !== 'null' - ? doclet.meta.path + '/' + doclet.meta.filename - : doclet.meta.filename; - - doclet.linenum = doclet.meta.lineno; // add the linenum to the base doclet so we can sort by it - doclet.meta.filepath = path.normalize(src); - // push the full source file path into the array if it doesn't exist - if (sourceFilePaths.indexOf(doclet.meta.filepath) === -1) { - sourceFilePaths.push(doclet.meta.filepath); - } - } - } - }); - - var pathToLongname = {}; - if (sourceFilePaths.length) { - var sources = [], root = template.options.sourceRootPath; - if (!root) root = path.commonPrefix(sourceFilePaths); - sourceFilePaths.forEach(function (filePath) { - var short = filePath.replace(root, '').replace(/\\/g, '/'); - var doclet = {kind: "source", longname: short, name: short, code: "", showTableOfContents: false}; - try { - doclet.code = helper.htmlsafe(fs.readFileSync(filePath, 'utf8')); - pathToLongname[filePath] = short; - registerDoclet(doclet); - sources.push(doclet); - } catch (e) { - handle(e); - } - }); - template.raw.data.insert(sources); - } - - // now that the sources are registered go back and update the default doclets so they contain the relevant source properties - template.raw.data().each(function (doclet) { - // only update default kinds with the source file info - if (template.kinds.custom.indexOf(doclet.kind) === -1) { - // if there is a registered source file for this doclet - if (doclet.meta && doclet.meta.filepath && pathToLongname[doclet.meta.filepath]) { - // build up the plain as well as html text source properties - doclet.source = pathToLongname[doclet.meta.filepath]; - doclet.sourcelink = helper.linkto(doclet.source); - if (template.options.linenums) { - doclet.sourcelink += ', ' + helper.linkto(doclet.source, 'line ' + doclet.meta.lineno, null, 'line-' + doclet.meta.lineno); - } - } - doclet.hasSource = !!(doclet.source && (template.options.outputSourceFiles || template.options.outputSourcePath)); - } - }); -}; - -var flattenTutorialConfig = function(obj, base){ - if (!base) base = {}; - Object.keys(obj).forEach(function(key){ - var config = obj[key]; - base[key] = config; - if (config && config.children && !config.children.length){ - flattenTutorialConfig(config.children, base); - } - }); - return base; -}; - -var getTutorialToConfig = function(){ - if (!template.config.dir.tutorials) return {}; - var files = glob.sync('*.json', {cwd: template.config.dir.tutorials}), json = {}; - files.forEach(function(file){ - var raw = fs.readFileSync(path.join(template.config.dir.tutorials, file), "utf8"); - extend(true, json, JSON.parse(raw)); - }); - return flattenTutorialConfig(json); -}; - -var processTutorial = function(tutorial, tutorials, tutorialToConfig){ - if (!tutorials) tutorials = []; - tutorial.children.forEach(function(child) { - child.kind = 'tutorial'; - child.longname = child.name; - child.title = child.title || child.name; - child.memberof = tutorial.name; - child.contents = child.parse(); - child.showTableOfContents = template.options.showTableOfContents; - var config; - if (config = tutorialToConfig[child.longname]){ - if (config.summary){ - child.summary = config.summary; - } - if (config.description){ - child.description = config.description; - } - if (typeof config.showTableOfContents === 'boolean'){ - child.showTableOfContents = config.showTableOfContents; - } - } - tutorials.push(child); - processTutorial(child, tutorials, tutorialToConfig); - }); - return tutorials; -}; - -exports.registerTutorials = function(){ - helper.setTutorials(template.raw.tutorials); - var tutorialToConfig = getTutorialToConfig(); - var tutorials = processTutorial(template.raw.tutorials, false, tutorialToConfig); - tutorials.forEach(function(tutorial){ - template.raw.data.insert(tutorial); - }); -}; - -exports.registerLists = function(){ - template.options.navMembers.forEach(function(member){ - // the global kind is register just after the index to reserve it's name so don't do it again - if (member.kind == "global") return; - - var doclet = { - kind: 'list', - longname: "list:" + member.kind, - for: member.kind, - name: member.title, - summary: member.summary, - showTableOfContents: true, - showAccessFilter: false, - members: template.find({kind: member.kind}, "longname, version, since") - }; - if (member.kind == 'tutorial'){ - doclet.members = doclet.members.filter(function(m){ return !m.memberof; }); - } - registerDoclet(doclet); - template.raw.data.insert(doclet); - }); -}; - -exports.buildNavbar = function(navbar){ - navbar.index = { - kind: 'readme', - link: helper.longnameToUrl['index'], - title: template.options.systemName, - summary: template.options.systemSummary, - members: [] - }; - navbar.topLevel = template.find({kind:['list','global']}, "longname, name").filter(function(doclet){ - return doclet.members.length > 0 && (doclet.kind == 'list' || template.hasNavMember(doclet.kind)); - }).map(function(doclet){ - return { - title: doclet.name, - summary: doclet.summary, - link: helper.longnameToUrl[doclet.longname], - members: doclet.members.map(function(member){ - return template.linkto(member.longname); - }) - }; - }); -}; \ No newline at end of file +var fs = require("jsdoc/fs"); +var path = require("jsdoc/path"); +var helper = require("jsdoc/util/templateHelper"); +var doop = require("jsdoc/util/doop"); +var handle = require("jsdoc/util/error").handle; +var template = require("./template"); +var doc = require("./docletHelper"); +var glob = require("glob"); +var extend = require("extend"); + +exports.process = function () { + template.raw.data.sort(template.options.sort); + + template.raw.data().each(function (doclet) { + doclet.ancestors = helper.getAncestorLinks(template.raw.data, doclet); + doclet.linkText = doc.getLinkText(doclet); + doclet.summary = doc.getSummary(doclet); + doclet.params = doc.getParamsOrProps(doclet, "params"); + doc.checkParamsOrProps(doclet, "params"); + doclet.properties = doc.getParamsOrProps(doclet, "properties"); + doc.checkParamsOrProps(doclet, "properties"); + doclet.attribs = doc.getAttribs(doclet); + doclet.signature = doc.getSignature(doclet); + doclet.examples = doc.getExamples(doclet); + doclet.fires = doc.getFires(doclet); + doclet.requires = doc.getRequires(doclet); + doclet.pageTitle = doc.getPageTitle(doclet, true); + doclet.pageTitleHTML = doc.getPageTitle(doclet, false); + doclet.symbolTitle = doc.getSymbolTitle(doclet, true); + doclet.symbolTitleHTML = doc.getSymbolTitle(doclet, false); + doclet.primaryTitle = doc.getPrimaryTitle(doclet, true); + doclet.primaryTitleHTML = doc.getPrimaryTitle(doclet, false); + doclet.listTitle = doc.getListTitle(doclet, true); + doclet.listTitleHTML = doc.getListTitle(doclet, false); + doclet.hasDetails = doc.hasDetails(doclet); + doclet.inherited = doc.isInherited(doclet); + doclet.access = typeof doclet.access == "string" ? doclet.access : "public"; + // todo: maybe expose this as an additional option, basically switches the description to a summary if no summary was supplied and the descriptions text is shorter than 120 characters + //if (!doclet.summary.length && doclet.description && template.sanitize(doclet.description).length <= 120){ + // doclet.summary = doclet.description; + // doclet.description = ''; + //} + if (typeof doclet.showTableOfContents != "boolean") { + doclet.showTableOfContents = template.options.showTableOfContents; + } + }); + + template.raw.data().each(function (doclet) { + doclet.symbols = doc.getSymbols(doclet); + doclet.showAccessFilter = doc.getShowAccessFilter(doclet); + }); +}; + +var hasOwnProp = Object.prototype.hasOwnProperty; +function getFilename(longname) { + var fileUrl; + if (hasOwnProp.call(helper.longnameToUrl, longname)) { + fileUrl = helper.longnameToUrl[longname]; + } else { + fileUrl = helper.getUniqueFilename(longname); + helper.registerLink(longname, fileUrl); + } + return fileUrl; +} + +/** + * @summary Registers the given doclet creating and registering a link for it and appending an id value to use when rendering in HTML. + * @param doclet - The doclet to register. + */ +var registerDoclet = (exports.registerDoclet = function (doclet) { + var url; + if (template.kinds.custom.indexOf(doclet.kind) !== -1) { + url = helper.getUniqueFilename(doclet.longname); + } else if (doclet.kind === "event") { + url = getFilename(doclet.memberof || helper.globalName); + if (doclet.name !== doclet.longname || doclet.scope === helper.globalName) { + url += + "#" + + (helper.scopeToPunc[doclet.scope] === "#" ? "" : helper.scopeToPunc[doclet.scope]) + + "event:" + + doclet.name.replace(/(^"|"$)/g, ""); + } + } else { + url = helper.createLink(doclet); + } + helper.registerLink(doclet.longname, url); + if (helper.longnameToUrl[doclet.longname].indexOf("#") > -1) { + doclet.id = helper.longnameToUrl[doclet.longname].split(/#/).pop(); + } else { + doclet.id = doclet.name; + } +}); + +/** + * @summary Registers the README.md file as the `readme` doclet. + * @description This not only registers the doclet but also the link associated with it, reserving it prior to registering any other links. + * + * The doclet is built up using the `systemName` and `systemSummary` options as the values for the associated `name` and `summary` properties of a doclet. The `longname` is simply the filename which is `index.html` and the `contents` is the markdown parsed `README.md` supplied as a source to jsdoc. + * @example {@caption The following shows the basic structure of the generated doclet.} + * { + * kind: "readme", + * longname: "index.html", + * name: "", + * summary: "", + * contents: "" + * } + */ +exports.registerReadme = function () { + var doclet = { + kind: "readme", + longname: "index", + name: template.options.systemName, + summary: template.options.systemSummary, + contents: template.raw.opts.readme, + }; + registerDoclet(doclet); + template.raw.data.insert(doclet); +}; + +exports.registerGlobals = function () { + var options = template.options.navMembers.find(function (member) { + return member.kind === "global"; + }); + if (!options) { + options = { + title: "Globals", + summary: "All documented globals.", + }; + } + var doclet = { + kind: "global", + longname: helper.globalName, + name: options.title, + summary: options.summary, + members: template.find( + { + kind: template.kinds.global, + memberof: { isUndefined: true }, + }, + "longname, version, since" + ), + showTableOfContents: true, + showAccessFilter: false, + }; + registerDoclet(doclet); + template.raw.data.insert(doclet); +}; + +exports.registerListeners = function () { + helper.addEventListeners(template.raw.data); +}; + +/** + * @summary Registers all default doclets. + */ +exports.registerDoclets = function () { + template.raw.data().each(function (doclet) { + if (template.kinds.custom.indexOf(doclet.kind) === -1) { + registerDoclet(doclet); + } + }); +}; + +exports.registerModules = function () { + var mapping = {}; + template.raw + .data({ + kind: ["class", "function"], + longname: { + left: "module:", + }, + }) + .each(function (doclet) { + var longname = doclet.longname; + mapping[longname] = mapping[longname] || []; + mapping[longname].push(doclet); + }); + template.raw.data({ kind: "module" }).each(function (module) { + if (mapping[module.longname]) { + mapping[module.longname] + .filter(function (doclet) { + return doclet.summary || doclet.description || doclet.kind === "class"; + }) + .forEach(function (doclet) { + doclet.exported = true; + doclet.memberof = module.longname; + var scope = helper.scopeToPunc[doclet.scope] || ">"; + doclet.longname = module.longname + scope + doclet.name; + }); + } + }); +}; + +/** + * @summary Registers all source files as a `source` doclet. + * @description This method takes into account the `sourceRootPath` option and will remove this value from the file path when generating the `longname` value for the doclet. If this option is not supplied the default behavior is to find the common prefix of all file paths and trim that. + */ +exports.registerSources = function () { + var sourceFilePaths = []; + // iterate all default doclets and build the source file path if the file meta exists and add it to the doclet as meta.filepath + template.raw.data().each(function (doclet) { + if (template.kinds.custom.indexOf(doclet.kind) === -1) { + if (doclet.meta) { + var src = + doclet.meta.path && doclet.meta.path !== "null" + ? doclet.meta.path + "/" + doclet.meta.filename + : doclet.meta.filename; + + doclet.linenum = doclet.meta.lineno; // add the linenum to the base doclet so we can sort by it + doclet.meta.filepath = path.normalize(src); + // push the full source file path into the array if it doesn't exist + if (sourceFilePaths.indexOf(doclet.meta.filepath) === -1) { + sourceFilePaths.push(doclet.meta.filepath); + } + } + } + }); + + var pathToLongname = {}; + if (sourceFilePaths.length) { + var sources = [], + root = template.options.sourceRootPath; + if (!root) root = path.commonPrefix(sourceFilePaths); + sourceFilePaths.forEach(function (filePath) { + var short = filePath.replace(root, "").replace(/\\/g, "/"); + var doclet = { + kind: "source", + longname: short, + name: short, + code: "", + showTableOfContents: false, + }; + try { + doclet.code = helper.htmlsafe(fs.readFileSync(filePath, "utf8")); + pathToLongname[filePath] = short; + registerDoclet(doclet); + sources.push(doclet); + } catch (e) { + handle(e); + } + }); + template.raw.data.insert(sources); + } + + // now that the sources are registered go back and update the default doclets so they contain the relevant source properties + template.raw.data().each(function (doclet) { + // only update default kinds with the source file info + if (template.kinds.custom.indexOf(doclet.kind) === -1) { + // if there is a registered source file for this doclet + if (doclet.meta && doclet.meta.filepath && pathToLongname[doclet.meta.filepath]) { + // build up the plain as well as html text source properties + doclet.source = pathToLongname[doclet.meta.filepath]; + doclet.sourcelink = helper.linkto(doclet.source); + if (template.options.linenums) { + doclet.sourcelink += + ", " + helper.linkto(doclet.source, "line " + doclet.meta.lineno, null, "line-" + doclet.meta.lineno); + } + } + doclet.hasSource = !!(doclet.source && (template.options.outputSourceFiles || template.options.outputSourcePath)); + } + }); +}; + +var flattenTutorialConfig = function (obj, base) { + if (!base) base = {}; + Object.keys(obj).forEach(function (key) { + var config = obj[key]; + base[key] = config; + if (config && config.children && !config.children.length) { + flattenTutorialConfig(config.children, base); + } + }); + return base; +}; + +var getTutorialToConfig = function () { + if (!template.config.dir.tutorials) return {}; + var files = glob.sync("*.json", { cwd: template.config.dir.tutorials }), + json = {}; + files.forEach(function (file) { + var raw = fs.readFileSync(path.join(template.config.dir.tutorials, file), "utf8"); + extend(true, json, JSON.parse(raw)); + }); + return flattenTutorialConfig(json); +}; + +var processTutorial = function (tutorial, tutorials, tutorialToConfig) { + if (!tutorials) tutorials = []; + tutorial.children.forEach(function (child) { + child.kind = "tutorial"; + child.longname = child.name; + child.title = child.title || child.name; + child.memberof = tutorial.name; + child.contents = child.parse(); + child.showTableOfContents = template.options.showTableOfContents; + var config; + if ((config = tutorialToConfig[child.longname])) { + if (config.summary) { + child.summary = config.summary; + } + if (config.description) { + child.description = config.description; + } + if (typeof config.showTableOfContents === "boolean") { + child.showTableOfContents = config.showTableOfContents; + } + } + tutorials.push(child); + processTutorial(child, tutorials, tutorialToConfig); + }); + return tutorials; +}; + +exports.registerTutorials = function () { + helper.setTutorials(template.raw.tutorials); + var tutorialToConfig = getTutorialToConfig(); + var tutorials = processTutorial(template.raw.tutorials, false, tutorialToConfig); + tutorials.forEach(function (tutorial) { + template.raw.data.insert(tutorial); + }); +}; + +exports.registerLists = function () { + template.options.navMembers.forEach(function (member) { + // the global kind is register just after the index to reserve it's name so don't do it again + if (member.kind == "global") return; + + var doclet = { + kind: "list", + longname: "list:" + member.kind, + for: member.kind, + name: member.title, + summary: member.summary, + showTableOfContents: true, + showAccessFilter: false, + members: template.find({ kind: member.kind }, "longname, version, since"), + }; + if (member.kind == "tutorial") { + doclet.members = doclet.members.filter(function (m) { + return !m.memberof; + }); + } + registerDoclet(doclet); + template.raw.data.insert(doclet); + }); +}; + +exports.buildNavbar = function (navbar) { + navbar.index = { + kind: "readme", + link: helper.longnameToUrl["index"], + title: template.options.systemName, + summary: template.options.systemSummary, + members: [], + }; + navbar.topLevel = template + .find({ kind: ["list", "global"] }, "longname, name") + .filter(function (doclet) { + return doclet.members.length > 0 && (doclet.kind == "list" || template.hasNavMember(doclet.kind)); + }) + .map(function (doclet) { + return { + title: doclet.name, + summary: doclet.summary, + link: helper.longnameToUrl[doclet.longname], + members: doclet.members.map(function (member) { + return template.linkto(member.longname); + }), + }; + }); +}; diff --git a/__DOCS__/JSDocTemplate/template/utils/template.js b/__DOCS__/JSDocTemplate/template/utils/template.js index f662d33..0ef49c3 100644 --- a/__DOCS__/JSDocTemplate/template/utils/template.js +++ b/__DOCS__/JSDocTemplate/template/utils/template.js @@ -1,257 +1,307 @@ -var fs = require('jsdoc/fs'); -var path = require('jsdoc/path'); -var helper = require('jsdoc/util/templateHelper'); -var markdown = require('jsdoc/util/markdown').getParser(); -var hbs = require('./handlebarsHelper'); -var lunr = require('./lunrHelper'); -var processor = require('./postProcessor'); -var sanitizeHtml = require('sanitize-html'); -var extend = require('extend'); -var moment = require('moment'); - -var kinds = exports.kinds = { - custom: ['readme', 'global', 'source', 'tutorial', 'list'], - pages: ['readme', 'global', 'source', 'tutorial', 'list', 'class', 'external', 'mixin', 'module', 'namespace', 'interface'], - symbols: ['tutorial', 'class', 'external', 'event', 'mixin', 'module', 'namespace', 'interface', 'member', 'function', 'constant', 'typedef'], - global: ['member', 'function', 'constant', 'typedef'] -}; - -var options = exports.options = extend({ - includeDate: true, - dateFormat: "Do MMM YYYY", - systemName: "FooDoc", - systemSummary: "A Bootstrap and Handlebars based template for JSDoc3.", - systemLogo: "", - systemColor: "", - navMembers: [], - footer: "", - copyright: "FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects.", - linenums: true, - collapseSymbols: true, - inverseNav: true, - inlineNav: false, - outputSourceFiles: true, - sourceRootPath: null, - disablePackagePath: true, - outputSourcePath: false, - showTableOfContents: true, - showAccessFilter: true, - analytics: null, - methodHeadingReturns: true, - sort: "linenum, longname, version, since", - search: true, - favicon: null, - stylesheets: [], - scripts: [] -}, env.conf.templates || {}); -if (!options.navMembers.length){ - options.navMembers = [ - {"kind": "class", "title": "Classes", "summary": "All documented classes."}, - {"kind": "external", "title": "Externals", "summary": "All documented external members."}, - {"kind": "global", "title": "Globals", "summary": "All documented globals."}, - {"kind": "mixin", "title": "Mixins", "summary": "All documented mixins."}, - {"kind": "interface", "title": "Interfaces", "summary": "All documented interfaces."}, - {"kind": "module", "title": "Modules", "summary": "All documented modules."}, - {"kind": "namespace", "title": "Namespaces", "summary": "All documented namespaces."}, - {"kind": "tutorial", "title": "Tutorials", "summary": "All available tutorials."} -]; -} - -var faviconTypes = { - '.ico': 'image/x-icon', - '.png': 'image/png', - '.jpg': 'image/jpeg', - '.jpeg': 'image/jpeg', - '.gif': 'image/gif' -}; - -var config = exports.config = { - debug: false, - raw: env.opts, - version: env.version.number, - date: moment().format(options.dateFormat), - faviconType: options.favicon ? faviconTypes[path.extname(options.favicon)] : null, - dir: { - root: null, - tmpl: null, - static: null, - output: env.opts.destination, - images: path.join( env.opts.destination, 'img' ), - tutorials: env.opts.tutorials - } -}; - -var raw = exports.raw = { - data: null, - opts: {}, - tutorials: [] -}; - -var configured = false; -exports.configure = function(taffyData, opts, tutorials){ - raw.data = helper.prune(taffyData); - raw.opts = opts; - raw.tutorials = tutorials; - config.dir.root = opts.templates; - config.dir.tmpl = path.join(opts.template, 'tmpl'); - config.dir.static = path.join(opts.template, 'static'); - configured = true; - return config; -}; - -var navbar = exports.navbar = {}; - -exports.postProcess = function(){ - processor.registerReadme(); - processor.registerModules(); - processor.registerGlobals(); - processor.registerDoclets(); - processor.registerSources(); - processor.registerTutorials(); - processor.registerLists(); - processor.process(); - processor.buildNavbar(navbar); -}; - -exports.publish = function(){ - generateStaticFiles(); - generateDocs(); - lunr.writeFilesSync(true); -}; - -exports.sanitize = function(html){ - if (typeof html !== 'string') return; - return sanitizeHtml(html, {allowedTags: [], allowedAttributes: []}).replace(/\s+/g, ' ').trim(); -}; - -/** - * @summary Find items in the current TaffyDB that match the specified key-value pairs. - * @param {Object|function} spec - An object of key-value pairs to match against (e.g. `{longname:"foo"}`), or a function that returns `true` if a value matches. - * @returns {Array.} The matching items. - * @example {@caption The following shows supplying an object to perform a by example search against the data.} - * var foo = helper.find({longname:"foo"}).first(); // get the first doclet with a longname of `foo` - * var children = helper.find({memberof:"foo"}); // get all doclets which belong to the `foo` doclet. - */ -var find = exports.find = function (spec, sort) { - if (!configured) return []; - return sort ? raw.data(spec).order(sort).get() : raw.data(spec).get(); -}; - -var linkto = exports.linkto = function(longname, linkText){ - var text = (linkText || longname)+''; - // if no linkText was supplied lookup the longname and use the `linkText` property for the doclet. - if (typeof linkText !== 'string'){ - var found = find({longname: longname}); - if (found.length && found[0].kind){ - var doclet = found[0]; - text = doclet.linkText || text; - if (doclet.kind === 'tutorial'){ - return helper.toTutorial(doclet.longname, text, { tag: 'em', classname: 'disabled' }); - } - } - } - return helper.linkto(longname, text); -}; - -var getPages = exports.getPages = function(sort){ - var members = {}; - kinds.pages.forEach(function(kind){ - members[kind] = find({kind: kind}, sort); - }); - return members; -}; - -var generateStaticFiles = exports.generateStaticFiles = function(){ - // first copy all files within the templates 'static' directory to the output directory - var files = fs.ls(config.dir.static, 3); - files.forEach(function(fileName){ - var toDir = fs.toDir( fileName.replace( config.dir.static, config.dir.output ) ); - fs.mkPath( toDir ); - fs.copyFileSync( fileName, toDir ); - }); - - // then copy the systemLogo file if one was supplied and update the option with the output file path - if (options.systemLogo){ - var stats = fs.lstatSync(options.systemLogo); - if (stats.isFile()){ - fs.mkPath(config.dir.images); - fs.copyFileSync(options.systemLogo, config.dir.images); - options.systemLogo = 'img/'+path.basename(options.systemLogo); - } - } - - // same for the favicon - if (options.favicon){ - var stats = fs.lstatSync(options.favicon); - if (stats.isFile()){ - fs.copyFileSync(options.favicon, env.opts.destination, 'favicon' + path.extname(options.favicon)); - options.favicon = 'favicon' + path.extname(options.favicon); - } - } - - // then copy all user supplied files - var userFiles; - if (options.default && (userFiles = options.default.staticFiles)) { - // The canonical property name is `include`. We accept `paths` for backwards compatibility with a bug in JSDoc 3.2.x. - var paths = userFiles.include || userFiles.paths || []; - var filter = new (require('jsdoc/src/filter')).Filter(userFiles); - var scanner = new (require('jsdoc/src/scanner')).Scanner(); - paths.forEach(function(filePath) { - var files = scanner.scan([filePath], 10, filter); - files.forEach(function(fileName) { - var from = fs.toDir(filePath); - var toDir = fs.toDir( fileName.replace(from, config.dir.output) ); - fs.mkPath(toDir); - fs.copyFileSync(fileName, toDir); - }); - }); - } -}; - -var generateDocs = exports.generateDocs = function(){ - var pages = getPages(); - Object.keys(pages).forEach(function(kind){ - if (pages[kind].length){ - pages[kind].forEach(function(doclet){ - var filename = doclet.kind === 'tutorial' ? helper.tutorialToUrl(doclet.longname) : helper.longnameToUrl[doclet.longname]; - if (!filename) return; - - if (doclet.kind === 'list' && !doclet.members.length) return; - - var output = path.join(config.dir.output, filename), - html = hbs.render(doclet, doclet.kind !== 'source'); - - if (html === null) return; - - fs.writeFileSync(output, html, 'utf8'); - if (doclet.kind !== 'source'){ - lunr.add(doclet, html); - } - }); - } - }); -}; - -var hasNavMember = exports.hasNavMember = function(kind){ - return options.navMembers.findIndex(function(member){ - return member.kind == kind; - }) != -1; -}; - -exports.createCrumbs = function(doclet){ - var crumbs = []; - if (doclet.kind === 'readme' || doclet.kind === 'source') return crumbs; - crumbs.push(linkto("index", "Home")); - if (doclet.kind !== 'list' && doclet.kind !== 'global' && hasNavMember(doclet.kind)){ - crumbs.push(linkto("list:"+doclet.kind)); - } - if (doclet.kind === 'tutorial'){ - helper.getAncestors(raw.data, doclet).forEach(function(ancestor){ - crumbs.push(linkto(ancestor.longname)); - }); - crumbs.push(doclet.title || doclet.name); - } else { - crumbs.push(doclet.ancestors.join('') + doclet.name); - } - return crumbs; -}; \ No newline at end of file +var fs = require("jsdoc/fs"); +var path = require("jsdoc/path"); +var helper = require("jsdoc/util/templateHelper"); +var markdown = require("jsdoc/util/markdown").getParser(); +var hbs = require("./handlebarsHelper"); +var lunr = require("./lunrHelper"); +var processor = require("./postProcessor"); +var sanitizeHtml = require("sanitize-html"); +var extend = require("extend"); +var moment = require("moment"); + +var kinds = (exports.kinds = { + custom: ["readme", "global", "source", "tutorial", "list"], + pages: [ + "readme", + "global", + "source", + "tutorial", + "list", + "class", + "external", + "mixin", + "module", + "namespace", + "interface", + ], + symbols: [ + "tutorial", + "class", + "external", + "event", + "mixin", + "module", + "namespace", + "interface", + "member", + "function", + "constant", + "typedef", + ], + global: ["member", "function", "constant", "typedef"], +}); + +var options = (exports.options = extend( + { + includeDate: true, + dateFormat: "Do MMM YYYY", + systemName: "FooDoc", + systemSummary: "A Bootstrap and Handlebars based template for JSDoc3.", + systemLogo: "", + systemColor: "", + navMembers: [], + footer: "", + copyright: "FooDoc Copyright © 2016 The contributors to the JSDoc3 and FooDoc projects.", + linenums: true, + collapseSymbols: true, + inverseNav: true, + inlineNav: false, + outputSourceFiles: true, + sourceRootPath: null, + disablePackagePath: true, + outputSourcePath: false, + showTableOfContents: true, + showAccessFilter: true, + analytics: null, + methodHeadingReturns: true, + sort: "linenum, longname, version, since", + search: true, + favicon: null, + stylesheets: [], + scripts: [], + }, + env.conf.templates || {} +)); +if (!options.navMembers.length) { + options.navMembers = [ + { kind: "class", title: "Classes", summary: "All documented classes." }, + { + kind: "external", + title: "Externals", + summary: "All documented external members.", + }, + { kind: "global", title: "Globals", summary: "All documented globals." }, + { kind: "mixin", title: "Mixins", summary: "All documented mixins." }, + { + kind: "interface", + title: "Interfaces", + summary: "All documented interfaces.", + }, + { kind: "module", title: "Modules", summary: "All documented modules." }, + { + kind: "namespace", + title: "Namespaces", + summary: "All documented namespaces.", + }, + { + kind: "tutorial", + title: "Tutorials", + summary: "All available tutorials.", + }, + ]; +} + +var faviconTypes = { + ".ico": "image/x-icon", + ".png": "image/png", + ".jpg": "image/jpeg", + ".jpeg": "image/jpeg", + ".gif": "image/gif", +}; + +var config = (exports.config = { + debug: false, + raw: env.opts, + version: env.version.number, + date: moment().format(options.dateFormat), + faviconType: options.favicon ? faviconTypes[path.extname(options.favicon)] : null, + dir: { + root: null, + tmpl: null, + static: null, + output: env.opts.destination, + images: path.join(env.opts.destination, "img"), + tutorials: env.opts.tutorials, + }, +}); + +var raw = (exports.raw = { + data: null, + opts: {}, + tutorials: [], +}); + +var configured = false; +exports.configure = function (taffyData, opts, tutorials) { + raw.data = helper.prune(taffyData); + raw.opts = opts; + raw.tutorials = tutorials; + config.dir.root = opts.templates; + config.dir.tmpl = path.join(opts.template, "tmpl"); + config.dir.static = path.join(opts.template, "static"); + configured = true; + return config; +}; + +var navbar = (exports.navbar = {}); + +exports.postProcess = function () { + processor.registerReadme(); + processor.registerModules(); + processor.registerGlobals(); + processor.registerDoclets(); + processor.registerSources(); + processor.registerTutorials(); + processor.registerLists(); + processor.process(); + processor.buildNavbar(navbar); +}; + +exports.publish = function () { + generateStaticFiles(); + generateDocs(); + lunr.writeFilesSync(true); +}; + +exports.sanitize = function (html) { + if (typeof html !== "string") return; + return sanitizeHtml(html, { allowedTags: [], allowedAttributes: [] }).replace(/\s+/g, " ").trim(); +}; + +/** + * @summary Find items in the current TaffyDB that match the specified key-value pairs. + * @param {Object|function} spec - An object of key-value pairs to match against (e.g. `{longname:"foo"}`), or a function that returns `true` if a value matches. + * @returns {Array.} The matching items. + * @example {@caption The following shows supplying an object to perform a by example search against the data.} + * var foo = helper.find({longname:"foo"}).first(); // get the first doclet with a longname of `foo` + * var children = helper.find({memberof:"foo"}); // get all doclets which belong to the `foo` doclet. + */ +var find = (exports.find = function (spec, sort) { + if (!configured) return []; + return sort ? raw.data(spec).order(sort).get() : raw.data(spec).get(); +}); + +var linkto = (exports.linkto = function (longname, linkText) { + var text = (linkText || longname) + ""; + // if no linkText was supplied lookup the longname and use the `linkText` property for the doclet. + if (typeof linkText !== "string") { + var found = find({ longname: longname }); + if (found.length && found[0].kind) { + var doclet = found[0]; + text = doclet.linkText || text; + if (doclet.kind === "tutorial") { + return helper.toTutorial(doclet.longname, text, { + tag: "em", + classname: "disabled", + }); + } + } + } + return helper.linkto(longname, text); +}); + +var getPages = (exports.getPages = function (sort) { + var members = {}; + kinds.pages.forEach(function (kind) { + members[kind] = find({ kind: kind }, sort); + }); + return members; +}); + +var generateStaticFiles = (exports.generateStaticFiles = function () { + // first copy all files within the templates 'static' directory to the output directory + var files = fs.ls(config.dir.static, 3); + files.forEach(function (fileName) { + var toDir = fs.toDir(fileName.replace(config.dir.static, config.dir.output)); + fs.mkPath(toDir); + fs.copyFileSync(fileName, toDir); + }); + + // then copy the systemLogo file if one was supplied and update the option with the output file path + if (options.systemLogo) { + var stats = fs.lstatSync(options.systemLogo); + if (stats.isFile()) { + fs.mkPath(config.dir.images); + fs.copyFileSync(options.systemLogo, config.dir.images); + options.systemLogo = "img/" + path.basename(options.systemLogo); + } + } + + // same for the favicon + if (options.favicon) { + var stats = fs.lstatSync(options.favicon); + if (stats.isFile()) { + fs.copyFileSync(options.favicon, env.opts.destination, "favicon" + path.extname(options.favicon)); + options.favicon = "favicon" + path.extname(options.favicon); + } + } + + // then copy all user supplied files + var userFiles; + if (options.default && (userFiles = options.default.staticFiles)) { + // The canonical property name is `include`. We accept `paths` for backwards compatibility with a bug in JSDoc 3.2.x. + var paths = userFiles.include || userFiles.paths || []; + var filter = new (require("jsdoc/src/filter").Filter)(userFiles); + var scanner = new (require("jsdoc/src/scanner").Scanner)(); + paths.forEach(function (filePath) { + var files = scanner.scan([filePath], 10, filter); + files.forEach(function (fileName) { + var from = fs.toDir(filePath); + var toDir = fs.toDir(fileName.replace(from, config.dir.output)); + fs.mkPath(toDir); + fs.copyFileSync(fileName, toDir); + }); + }); + } +}); + +var generateDocs = (exports.generateDocs = function () { + var pages = getPages(); + Object.keys(pages).forEach(function (kind) { + if (pages[kind].length) { + pages[kind].forEach(function (doclet) { + var filename = + doclet.kind === "tutorial" ? helper.tutorialToUrl(doclet.longname) : helper.longnameToUrl[doclet.longname]; + if (!filename) return; + + if (doclet.kind === "list" && !doclet.members.length) return; + + var output = path.join(config.dir.output, filename), + html = hbs.render(doclet, doclet.kind !== "source"); + + if (html === null) return; + + fs.writeFileSync(output, html, "utf8"); + if (doclet.kind !== "source") { + lunr.add(doclet, html); + } + }); + } + }); +}); + +var hasNavMember = (exports.hasNavMember = function (kind) { + return ( + options.navMembers.findIndex(function (member) { + return member.kind == kind; + }) != -1 + ); +}); + +exports.createCrumbs = function (doclet) { + var crumbs = []; + if (doclet.kind === "readme" || doclet.kind === "source") return crumbs; + crumbs.push(linkto("index", "Home")); + if (doclet.kind !== "list" && doclet.kind !== "global" && hasNavMember(doclet.kind)) { + crumbs.push(linkto("list:" + doclet.kind)); + } + if (doclet.kind === "tutorial") { + helper.getAncestors(raw.data, doclet).forEach(function (ancestor) { + crumbs.push(linkto(ancestor.longname)); + }); + crumbs.push(doclet.title || doclet.name); + } else { + crumbs.push(doclet.ancestors.join("") + doclet.name); + } + return crumbs; +}; diff --git a/__DOCS__/JSDocTemplate/test-src/collapse.conf.json b/__DOCS__/JSDocTemplate/test-src/collapse.conf.json index c3a4e15..a4c4c59 100644 --- a/__DOCS__/JSDocTemplate/test-src/collapse.conf.json +++ b/__DOCS__/JSDocTemplate/test-src/collapse.conf.json @@ -1,13 +1,13 @@ -{ - "tags": { - "allowUnknownTags": true - }, - "plugins": ["plugins/markdown"], - "templates": { - "collapseSymbols": false - }, - "markdown": { - "parser": "gfm", - "hardwrap": true - } -} +{ + "tags": { + "allowUnknownTags": true + }, + "plugins": ["plugins/markdown"], + "templates": { + "collapseSymbols": false + }, + "markdown": { + "parser": "gfm", + "hardwrap": true + } +} diff --git a/__DOCS__/JSDocTemplate/test-src/default.conf.json b/__DOCS__/JSDocTemplate/test-src/default.conf.json index 5bba89f..65a4acd 100644 --- a/__DOCS__/JSDocTemplate/test-src/default.conf.json +++ b/__DOCS__/JSDocTemplate/test-src/default.conf.json @@ -1,11 +1,11 @@ -{ - "tags": { - "allowUnknownTags": true - }, - "plugins": ["plugins/markdown"], - "templates": {}, - "markdown": { - "parser": "gfm", - "hardwrap": true - } -} +{ + "tags": { + "allowUnknownTags": true + }, + "plugins": ["plugins/markdown"], + "templates": {}, + "markdown": { + "parser": "gfm", + "hardwrap": true + } +} diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/base/chains.js b/__DOCS__/JSDocTemplate/test-src/fixtures/base/chains.js index 124ae38..6ec1ed4 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/base/chains.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/base/chains.js @@ -1,70 +1,70 @@ -"use strict"; -/** - * @fileOverview The chains define the primary composition elements (functions) that determine the order of execution. - * - * @module base/chains - * @requires dcl - */ -var dcl = require( "dcl" ); -/** - * @classDesc Chains define the primary composition elements (functions) that determine the order of execution. - * @exports base/chains - * @constructor - */ -var Chains = dcl( null, {declaredClass : "base/chains"} ); -/** - * The `close` method asks an object to shut itself down in a way that will allow it to be reopened, unlike the - * [end method]{@link base/chains#end} which will call the destroy method which should make the object unusable, but also - * devoid of all resources whereas `close` may still keep some resources open. - * - * | Heading 1 | Heading 2 | Heading 3 | - * |-----------|-----------|-----------------| - * | Bar | Food | This is a table | - * - * This uses the `before` chain which means the last one defined in the first one destroyed - * @memberOf base/chains# - * @name close - * @see base/chains#open - */ -dcl.chainBefore( Chains, "close" ); -/** - * The `end` method will call the destroy method which should make the object unusable and - * devoid of all resources, unlike the - * [close method]{@link base/chains#close} asks an object to shut itself down in a way that will allow it to be reopened. - * - * This uses the `before` chain which means the last one defined in the first one destroyed - * @memberOf base/chains# - * @name end - * - * @example Add *this* to your application.properties. - * {@lang bash} - * foo=bar - * - */ -dcl.chainBefore( Chains, "end" ); -/** - * Destroy is called by the end method and it is here that you should clean up after yourself. The difference between - * `destroy` and [end]{@link base/chains#end} is the `end` is the verb that you raise on an object to ask it to go away - * and `destroy` is where you actually do the work to clean up. Think of this as the counterpart of `constructor` yet - * not called automatically. - * - * This uses the `before` chain which means the last one defined is the first one destroyed - * @private - * @memberOf base/chains# - * @name destroy - */ -dcl.chainBefore( Chains, "destroy" ); - -/** - * If you are using the open/close paradigm for an object that can kind of go dormant on {@link base/chains#close} and can be "reopened" - * again later, here is where the "open" code will go. - * - * This used the `after` chain which means that the first one defined is the first one destroyed. - * - * @memberOf base/chains# - * @name open - * @see base/chains#close - */ -dcl.chainAfter( Chains, "open" ); - -module.exports = Chains; +"use strict"; +/** + * @fileOverview The chains define the primary composition elements (functions) that determine the order of execution. + * + * @module base/chains + * @requires dcl + */ +var dcl = require("dcl"); +/** + * @classDesc Chains define the primary composition elements (functions) that determine the order of execution. + * @exports base/chains + * @constructor + */ +var Chains = dcl(null, { declaredClass: "base/chains" }); +/** + * The `close` method asks an object to shut itself down in a way that will allow it to be reopened, unlike the + * [end method]{@link base/chains#end} which will call the destroy method which should make the object unusable, but also + * devoid of all resources whereas `close` may still keep some resources open. + * + * | Heading 1 | Heading 2 | Heading 3 | + * |-----------|-----------|-----------------| + * | Bar | Food | This is a table | + * + * This uses the `before` chain which means the last one defined in the first one destroyed + * @memberOf base/chains# + * @name close + * @see base/chains#open + */ +dcl.chainBefore(Chains, "close"); +/** + * The `end` method will call the destroy method which should make the object unusable and + * devoid of all resources, unlike the + * [close method]{@link base/chains#close} asks an object to shut itself down in a way that will allow it to be reopened. + * + * This uses the `before` chain which means the last one defined in the first one destroyed + * @memberOf base/chains# + * @name end + * + * @example Add *this* to your application.properties. + * {@lang bash} + * foo=bar + * + */ +dcl.chainBefore(Chains, "end"); +/** + * Destroy is called by the end method and it is here that you should clean up after yourself. The difference between + * `destroy` and [end]{@link base/chains#end} is the `end` is the verb that you raise on an object to ask it to go away + * and `destroy` is where you actually do the work to clean up. Think of this as the counterpart of `constructor` yet + * not called automatically. + * + * This uses the `before` chain which means the last one defined is the first one destroyed + * @private + * @memberOf base/chains# + * @name destroy + */ +dcl.chainBefore(Chains, "destroy"); + +/** + * If you are using the open/close paradigm for an object that can kind of go dormant on {@link base/chains#close} and can be "reopened" + * again later, here is where the "open" code will go. + * + * This used the `after` chain which means that the first one defined is the first one destroyed. + * + * @memberOf base/chains# + * @name open + * @see base/chains#close + */ +dcl.chainAfter(Chains, "open"); + +module.exports = Chains; diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/base/index.js b/__DOCS__/JSDocTemplate/test-src/fixtures/base/index.js index b64ec20..9ed3dee 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/base/index.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/base/index.js @@ -1,73 +1,76 @@ -"use strict"; -/** - * @fileOverview This is base definition for all composed classes defined by the system - * @module base - * @requires base/chains - * @requires dcl - */ - -var dcl = require( "dcl" ); -var chains = require( "./chains" ); - -/** - * @classdesc The base of all classes in the system, this is one of the few pure "classes" in core the of the system. It is a - * pretty clean little class whose primary purpose is to surface the composition chains and a basis for storing - * options on mixin and subclass instances. Options are handled at the instance rather than the prototype level - * so that multiple instances don't compete for default values. - * - * @exports base - * @constructor - * @extends base/chains - */ -var Base = dcl( [chains], /** @lends base# */{ - declaredClass : "Base", - /** - * Add an option to a class. If any members of the hash already exist in `this.options`, they will be overwritten. - * @param {hash} options A hash of options you want to set - * @see {base#addDefaultOptions} - */ - addOptions : function ( options ) { - options = options || {}; - if ( this.options ) {options = sys.extend( {}, sys.result( this, 'options' ), options );} - this.options = options; - }, - /** - * Add a default option to a class. The default options are only set if there is not already a - * value for the option. - * @param {hash} options A hash of options you want to set - * @see {base#addOptions} - */ - addDefaultOptions : function ( options ) { - options = options || {}; - if ( this.options ) {options = sys.defaults( {}, sys.result( this, 'options' ), options );} - this.options = options; - }, - - /** - * Call this to close your object and dispose of all maintained resources. You can define this method on your - * own classes without having to call the superclass instance, however it is reccomended that you put - * all disposal code in `destroy()`. You must be disciplined about calling this on your instances. - * @see {base/chains#end} - * @see {base/chains#destroy} - */ - end : function () { - this.destroy() - }, - - /** - * Called when it is time to get rid of all of your instance level references and objects and events. You can - * define this method on your own classes without having to call the superclass instance. It is called by - * `instance.end()` automatically - * @see {base/chains#end} - * @see {base/chains#destroy} - */ - destroy : function () { - - } - - -} ); - -Base.compose = dcl; -Base.mixin = dcl.mix; -module.exports = Base; +"use strict"; +/** + * @fileOverview This is base definition for all composed classes defined by the system + * @module base + * @requires base/chains + * @requires dcl + */ + +var dcl = require("dcl"); +var chains = require("./chains"); + +/** + * @classdesc The base of all classes in the system, this is one of the few pure "classes" in core the of the system. It is a + * pretty clean little class whose primary purpose is to surface the composition chains and a basis for storing + * options on mixin and subclass instances. Options are handled at the instance rather than the prototype level + * so that multiple instances don't compete for default values. + * + * @exports base + * @constructor + * @extends base/chains + */ +var Base = dcl( + [chains], + /** @lends base# */ { + declaredClass: "Base", + /** + * Add an option to a class. If any members of the hash already exist in `this.options`, they will be overwritten. + * @param {hash} options A hash of options you want to set + * @see {base#addDefaultOptions} + */ + addOptions: function (options) { + options = options || {}; + if (this.options) { + options = sys.extend({}, sys.result(this, "options"), options); + } + this.options = options; + }, + /** + * Add a default option to a class. The default options are only set if there is not already a + * value for the option. + * @param {hash} options A hash of options you want to set + * @see {base#addOptions} + */ + addDefaultOptions: function (options) { + options = options || {}; + if (this.options) { + options = sys.defaults({}, sys.result(this, "options"), options); + } + this.options = options; + }, + + /** + * Call this to close your object and dispose of all maintained resources. You can define this method on your + * own classes without having to call the superclass instance, however it is reccomended that you put + * all disposal code in `destroy()`. You must be disciplined about calling this on your instances. + * @see {base/chains#end} + * @see {base/chains#destroy} + */ + end: function () { + this.destroy(); + }, + + /** + * Called when it is time to get rid of all of your instance level references and objects and events. You can + * define this method on your own classes without having to call the superclass instance. It is called by + * `instance.end()` automatically + * @see {base/chains#end} + * @see {base/chains#destroy} + */ + destroy: function () {}, + } +); + +Base.compose = dcl; +Base.mixin = dcl.mix; +module.exports = Base; diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/binder.js b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/binder.js index 047858d..b69c7b2 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/binder.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/binder.js @@ -1,178 +1,181 @@ -"use strict"; -/** - * @fileOverview allows you to bind a change watcher that looks for get and set operations on an arbitrary - * property of an object at at any depth. This allows you to look for changes or intercept values asynchronously or otherwise. - * @module documents/binder - * @requires async - * @requires documents/probe - * @requires lodash - * @requires promise - */ -var Promise = require( 'promise' ); -var async = require( "async" ); -var probe = require( "./probe" ); -var sys = require( "lodash" ); - -/** - * Identifies the properties that the binder expects - * @type {{getter: null, getterAsync: boolean, setter: null, validator: null, validatorAsync: boolean, setterAsync: boolean}} - * @private - */ -var dataBinderOptions = exports.dataBinderOptions = { - getter : null, - getterAsync : false, - setter : null, - validator : null, - validatorAsync : false, - setterAsync : false -}; - -/** - * You can unbind previously bound objects from here. - * - * @param {string} path The path that was bound using {@link module:documents/binder.bind} - * @param {*} record The object that was bound - */ -exports.unbind = function ( path, record ) { - var context = record; - var lastParent = context; - var parts = path.split( probe.delimiter ); - var lastPartName = path; - var lastParentName; - sys.each( parts, function ( part ) { - lastParentName = part; - lastParent = context; - context = context[part]; - lastPartName = part; - if ( sys.isNull( context ) || sys.isUndefined( context ) ) { - context = {}; - } - } ); - - if ( lastParent === context ) { - deleteBindings( record, lastPartName ); - } else { - deleteBindings( lastParent, lastPartName ); - } - - function deleteBindings( mountPoint, mountName ) { - mountPoint[mountName] = mountPoint["__" + mountName + "__"]; - delete mountPoint["__" + mountName + "__"]; - } -}; - -/** - * Bind to a property somewhere in an object. The property is found using dot notation and can be arbitrarily deep. - * @param {string} path The path into the object to locate the property. For instance this could be `"_id"`, `"name.last"`. - * or `"some.really.really.long.path.including.an.array.2.name"` - * @param {object} record Anything you can hang a property off of - * @param {options} options What you wanna do with the doohicky when yoyu bind it. - * @param {function(*):Promise|*=} options.getter This is the method to run when getting the value. When it runs, you will receive - * a single parameter which is the current value as the object understands it. You can return the value directly, just raise an event or - * whatever your little heart demands. However, if you are asynchronous, this will turn your return value into a promise, one of the - * few places this system will embrace promises over node-like error passing and that is mainly because this is a getter so a return value - * is particularly important. * - * @param {*} options.getter.value The current value of the record - * @param {function(err, value)=} options.getter.callback When asynchronous, return you value through this method using node style - * error passing (the promise is handled for you by this method). - * @param {boolean=} options.getterAsync When true (not truthy) the getter is treated asynchronously and returns a promise with your value. - * @param {function(*, *, *)=} options.setter A setter method - * @param {*} options.setter.newVal The new value - * @param {*} options.setter.oldVal The old value - * @param {*} options.setter.record The record hosting the change - * @param {function(*, *, *, function=)=} options.validator If you want a validator to run before settings values, pass this guy in - * @param {*} options.validator.newVal The new value - * @param {*} options.validator.oldVal The old value - * @param {*} options.validator.record The record hosting the change - * @param {function(err)=} options.validator.callback If the validator is asynchronous, then pass your value back here, otherwise pass it back as a return value. - * When you use an asynchronous instance, pass the error in the first value and then the rest of the parameters are yours to play with - * @param {boolean=} options.validatorAsync When true (not truthy) the validator is treated asynchornously and returns a promise with your value. - * @returns {*} - */ -exports.bind = function ( path, record, options ) { - options = sys.extend( {}, dataBinderOptions, options ); - var context = record; - var lastParent = context; - var parts = path.split( probe.delimiter ); - var lastPartName = path; - var lastParentName; - - sys.each( parts, function ( part ) { - lastParentName = part; - lastParent = context; - context = context[part]; - lastPartName = part; - if ( sys.isNull( context ) || sys.isUndefined( context ) ) { - context = {}; - } - } ); - - if ( lastParent === context ) { - setUpBindings( record, lastPartName ); - } else { - setUpBindings( lastParent, lastPartName ); - } - - function setUpBindings( mountPoint, mountName ) { - mountPoint["__" + mountName + "__"] = mountPoint[mountName]; - Object.defineProperty( mountPoint, mountName, { - get : function () { - if ( sys.isFunction( options.getter ) ) { - var promise; - if ( options.getterAsync === true ) { - promise = Promise.denodeify( options.getter ); - } - - if ( promise ) { - return promise( mountPoint["__" + mountName + "__"] ).then( function ( val ) { - mountPoint["__" + mountName + "__"] = val; - } ); - } else { - mountPoint["__" + mountName + "__"] = options.getter( mountPoint["__" + mountName + "__"] ); - return mountPoint["__" + mountName + "__"]; - } - - } else { - return mountPoint["__" + mountName + "__"]; - } - }, - set : function ( val ) { - async.waterfall( [ - function ( done ) { - if ( sys.isFunction( options.validator ) ) { - if ( options.validatorAsync ) { - options.validator( val, mountPoint["__" + mountName + "__"], record, done ); - } else { - var res = options.validator( val, mountPoint["__" + mountName + "__"], record ); - if ( res === true ) { - done(); - } else { - done( res ); - } - } - } else { - done(); - } - }, - function ( done ) { - if ( sys.isFunction( options.setter ) ) { - if ( options.setterAsync === true ) { - options.setter( val, mountPoint["__" + mountName + "__"], record, done ); - } else { - done( null, options.setter( val, mountPoint["__" + mountName + "__"], record ) ); - } - } else { - done( null, val ); - } - } - ], function ( err, newVal ) { - if ( err ) { throw new Error( err ); } - mountPoint["__" + mountName + "__"] = newVal; - } ); - - } - } ); - } - - return context; -}; +"use strict"; +/** + * @fileOverview allows you to bind a change watcher that looks for get and set operations on an arbitrary + * property of an object at at any depth. This allows you to look for changes or intercept values asynchronously or otherwise. + * @module documents/binder + * @requires async + * @requires documents/probe + * @requires lodash + * @requires promise + */ +var Promise = require("promise"); +var async = require("async"); +var probe = require("./probe"); +var sys = require("lodash"); + +/** + * Identifies the properties that the binder expects + * @type {{getter: null, getterAsync: boolean, setter: null, validator: null, validatorAsync: boolean, setterAsync: boolean}} + * @private + */ +var dataBinderOptions = (exports.dataBinderOptions = { + getter: null, + getterAsync: false, + setter: null, + validator: null, + validatorAsync: false, + setterAsync: false, +}); + +/** + * You can unbind previously bound objects from here. + * + * @param {string} path The path that was bound using {@link module:documents/binder.bind} + * @param {*} record The object that was bound + */ +exports.unbind = function (path, record) { + var context = record; + var lastParent = context; + var parts = path.split(probe.delimiter); + var lastPartName = path; + var lastParentName; + sys.each(parts, function (part) { + lastParentName = part; + lastParent = context; + context = context[part]; + lastPartName = part; + if (sys.isNull(context) || sys.isUndefined(context)) { + context = {}; + } + }); + + if (lastParent === context) { + deleteBindings(record, lastPartName); + } else { + deleteBindings(lastParent, lastPartName); + } + + function deleteBindings(mountPoint, mountName) { + mountPoint[mountName] = mountPoint["__" + mountName + "__"]; + delete mountPoint["__" + mountName + "__"]; + } +}; + +/** + * Bind to a property somewhere in an object. The property is found using dot notation and can be arbitrarily deep. + * @param {string} path The path into the object to locate the property. For instance this could be `"_id"`, `"name.last"`. + * or `"some.really.really.long.path.including.an.array.2.name"` + * @param {object} record Anything you can hang a property off of + * @param {options} options What you wanna do with the doohicky when yoyu bind it. + * @param {function(*):Promise|*=} options.getter This is the method to run when getting the value. When it runs, you will receive + * a single parameter which is the current value as the object understands it. You can return the value directly, just raise an event or + * whatever your little heart demands. However, if you are asynchronous, this will turn your return value into a promise, one of the + * few places this system will embrace promises over node-like error passing and that is mainly because this is a getter so a return value + * is particularly important. * + * @param {*} options.getter.value The current value of the record + * @param {function(err, value)=} options.getter.callback When asynchronous, return you value through this method using node style + * error passing (the promise is handled for you by this method). + * @param {boolean=} options.getterAsync When true (not truthy) the getter is treated asynchronously and returns a promise with your value. + * @param {function(*, *, *)=} options.setter A setter method + * @param {*} options.setter.newVal The new value + * @param {*} options.setter.oldVal The old value + * @param {*} options.setter.record The record hosting the change + * @param {function(*, *, *, function=)=} options.validator If you want a validator to run before settings values, pass this guy in + * @param {*} options.validator.newVal The new value + * @param {*} options.validator.oldVal The old value + * @param {*} options.validator.record The record hosting the change + * @param {function(err)=} options.validator.callback If the validator is asynchronous, then pass your value back here, otherwise pass it back as a return value. + * When you use an asynchronous instance, pass the error in the first value and then the rest of the parameters are yours to play with + * @param {boolean=} options.validatorAsync When true (not truthy) the validator is treated asynchornously and returns a promise with your value. + * @returns {*} + */ +exports.bind = function (path, record, options) { + options = sys.extend({}, dataBinderOptions, options); + var context = record; + var lastParent = context; + var parts = path.split(probe.delimiter); + var lastPartName = path; + var lastParentName; + + sys.each(parts, function (part) { + lastParentName = part; + lastParent = context; + context = context[part]; + lastPartName = part; + if (sys.isNull(context) || sys.isUndefined(context)) { + context = {}; + } + }); + + if (lastParent === context) { + setUpBindings(record, lastPartName); + } else { + setUpBindings(lastParent, lastPartName); + } + + function setUpBindings(mountPoint, mountName) { + mountPoint["__" + mountName + "__"] = mountPoint[mountName]; + Object.defineProperty(mountPoint, mountName, { + get: function () { + if (sys.isFunction(options.getter)) { + var promise; + if (options.getterAsync === true) { + promise = Promise.denodeify(options.getter); + } + + if (promise) { + return promise(mountPoint["__" + mountName + "__"]).then(function (val) { + mountPoint["__" + mountName + "__"] = val; + }); + } else { + mountPoint["__" + mountName + "__"] = options.getter(mountPoint["__" + mountName + "__"]); + return mountPoint["__" + mountName + "__"]; + } + } else { + return mountPoint["__" + mountName + "__"]; + } + }, + set: function (val) { + async.waterfall( + [ + function (done) { + if (sys.isFunction(options.validator)) { + if (options.validatorAsync) { + options.validator(val, mountPoint["__" + mountName + "__"], record, done); + } else { + var res = options.validator(val, mountPoint["__" + mountName + "__"], record); + if (res === true) { + done(); + } else { + done(res); + } + } + } else { + done(); + } + }, + function (done) { + if (sys.isFunction(options.setter)) { + if (options.setterAsync === true) { + options.setter(val, mountPoint["__" + mountName + "__"], record, done); + } else { + done(null, options.setter(val, mountPoint["__" + mountName + "__"], record)); + } + } else { + done(null, val); + } + }, + ], + function (err, newVal) { + if (err) { + throw new Error(err); + } + mountPoint["__" + mountName + "__"] = newVal; + } + ); + }, + }); + } + + return context; +}; diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/collector.js b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/collector.js index 22378a0..208f9ce 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/collector.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/collector.js @@ -1,496 +1,486 @@ -"use strict"; -/** - @fileOverview An object and array collector - @module ink/collector - */ - -var probe = require( "ink-probe" ); -var sys = require( "lodash" ); -var dcl = require( "dcl" ); - -/** - * A collector - * @constructor - */ -var CollectorBase = dcl( Destroyable, { - declaredClass : "CollectorBase", - constructor : function ( obj ) { - var that = this; - if ( obj && !sys.isObject( obj ) ) { - throw new TypeError( "Collectors require an initial object or array passed to the constructor" ); - } - /** - * The collection that being managed - * @type {object|array} - */ - this.heap = obj || {}; - // mixin the probe - probe.mixTo( this, this.heap ); - /** - * Get the size of the collection - * @name length - * @type {number} - * @memberOf module:documents/collector~CollectorBase# - */ - Object.defineProperty( this, "length", { - get : function () { - return sys.size( that.heap ); - } - } - ); - /** - * Creates an array of shuffled array values, using a version of the Fisher-Yates shuffle. - * See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. - * @function - * @memberOf module:documents/collector~CollectorBase# - * @returns {array} - */ - this.shuffle = sys.bind( sys.shuffle, this, this.heap ); - - }, - /** - * Adds an item to the collection - * @param {*} key The key to use for the item being added. - * @param {*} item The item to add to the collection. The item is not iterated so that you could add bundled items to the collection - */ - add : function ( key, item ) { - this.heap[key] = item; - }, - /** - * Iterate over each item in the collection, or a subset that matches a query. This supports two signatures: - * `.each(query, function)` and `.each(function)`. If you pass in a query, only the items that match the query - * are iterated over. - * @param {object=} query A query to evaluate - * @param {function(val, key)} iterator Function to execute against each item in the collection - * @param {object=} thisobj The value of `this` - */ - each : function ( query, iterator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - sys.each( this.find( query ), iterator, thisobj ); - } else { - thisobj = iterator || this; - sys.each( this.heap, query, thisobj ); - } - }, - /** - * Returns the collection as an array. If it is already an array, it just returns that. - * @return {array} - */ - toArray : function () { - return sys.toArray( this.heap ); - }, - /** - * Supports conversion to a JSON string or for passing over the wire - * @return {object} - * @returns {Object|array} - */ - toJSON : function () { - return this.heap; - }, - /** - * Maps the contents to an array by iterating over it and transforming it. You supply the iterator. Supports two signatures: - * `.map(query, function)` and `.map(function)`. If you pass in a query, only the items that match the query - * are iterated over. - * @param {object=} query A query to evaluate - * @param {function(val, key)} iterator Function to execute against each item in the collection - * @param {object=} thisobj The value of `this` - */ - map : function ( query, iterator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - return sys.map( this.find( query ), iterator, thisobj ); - } else { - thisobj = iterator || this; - return sys.map( this.heap, query, thisobj ); - } - }, - /** - * Reduces a collection to a value which is the accumulated result of running each element in the collection through the - * callback, where each successive callback execution consumes the return value of the previous execution. If accumulator - * is not passed, the first element of the collection will be used as the initial accumulator value. - * are iterated over. - * @param {object=} query A query to evaluate - * @param {function(result, val, key)} iterator The function that will be executed in each item in the collection - * @param {*=} accumulator Initial value of the accumulator. - * @param {object=} thisobj The value of `this` - * @return {*} - */ - reduce : function ( query, iterator, accumulator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - return sys.reduce( this.find( query ), iterator, accumulator, thisobj ); - } else { - thisobj = accumulator || this; - return sys.reduce( this.heap, query, iterator, thisobj ); - } - }, - /** - * Creates an object composed of keys returned from running each element - * of the collection through the given callback. The corresponding value of each key - * is the number of times the key was returned by the callback. - * @param {object=} query A query to evaluate. If you pass in a query, only the items that match the query - * are iterated over. - * @param {function(value, key, collection)} iterator - * @param {object=} thisobj The value of `this` - * @return {object} - */ - countBy : function ( query, iterator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - return sys.countBy( this.find( query ), iterator, thisobj ); - } else { - thisobj = iterator || this; - return sys.countBy( this.heap, query, thisobj ); - } - }, - /** - * Creates an object composed of keys returned from running each element of the collection through the callback. - * The corresponding value of each key is an array of elements passed to callback that returned the key. - * The callback is invoked with three arguments: (value, index|key, collection). - * @param {object=} query A query to evaluate . If you pass in a query, only the items that match the query - * are iterated over. - * @param {function(value, key, collection)} iterator - * @param {object=} thisobj The value of `this` - * @return {object} - */ - groupBy : function ( query, iterator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - return sys.groupBy( this.find( query ), iterator, thisobj ); - } else { - thisobj = iterator || this; - return sys.groupBy( this.heap, query, thisobj ); - } - }, - /** - * Reduce the collection to a single value. Supports two signatures: - * `.pluck(query, function)` and `.pluck(function)` - * @param {object=} query The query to evaluate. If you pass in a query, only the items that match the query - * are iterated over. - * @param {string} property The property that will be 'plucked' from the contents of the collection - * @return {*} - */ - pluck : function ( query, property ) { - if ( arguments.length === 2 ) { - return sys.map( this.find( query ), function ( record ) { - return probe.get( record, property ); - } ); - } else { - return sys.map( this.heap, function ( record ) { - return probe.get( record, query ); - } ); - } - }, - /** - * Returns a sorted copy of the collection. - * @param {object=} query The query to evaluate. If you pass in a query, only the items that match the query - * are iterated over. - * @param {function(value, key)} iterator - * @param {object=} thisobj The value of `this` - * @return {array} - */ - sortBy : function ( query, iterator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - return sys.sortBy( this.find( query ), iterator, thisobj ); - } else { - thisobj = iterator || this; - return sys.sortBy( this.heap, query, thisobj ); - } - }, - /** - * Retrieves the maximum value of an array. If callback is passed, - * it will be executed for each value in the array to generate the criterion by which the value is ranked. - * @param {object=} query A query to evaluate . If you pass in a query, only the items that match the query - * are iterated over. - * @param {function(value, key, collection)} iterator - * @param {object=} thisobj The value of `this` - * @return {number} - */ - max : function ( query, iterator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - return sys.max( this.find( query ), iterator, thisobj ); - } else { - thisobj = iterator || this; - return sys.max( this.heap, query, thisobj ); - } - }, - /** - * Retrieves the minimum value of an array. If callback is passed, - * it will be executed for each value in the array to generate the criterion by which the value is ranked. - * @param {object=} query A query to evaluate . If you pass in a query, only the items that match the query - * are iterated over. - * @param {function(value, key, collection)} iterator - * @param {object=} thisobj The value of `this` - * @return {number} - */ - min : function ( query, iterator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - return sys.min( this.find( query ), iterator, thisobj ); - } else { - thisobj = iterator || this; - return sys.min( this.heap, query, thisobj ); - } - }, - /** - * Destructor called when the object is destroyed. - */ - destroy : function () { - this.heap = null; - } -} ); - -/** - * An object based collector - * @extends module:documents/collector~CollectorBase - * @constructor - */ -var OCollector = dcl( CollectorBase, { - /** - * Get a record by key - * @param {*} key The key of the record to get - * @return {*} - */ - key : function ( key ) { - return this.heap[key]; - } -} ); - -//noinspection JSCommentMatchesSignature -/** - An array based collector - @extends module:documents/collector~CollectorBase - @constructor - */ -var ACollector = dcl( CollectorBase, { - constructor : function ( obj ) { - if ( obj && !sys.isArray( obj ) ) { - throw new TypeError( "Collectors require an array passed to the constructor" ); - } - this.heap = obj || []; - /** - * Creates an array of array elements not present in the other arrays using strict equality for comparisons, i.e. ===. - * @returns {array} - */ - this.difference = sys.bind( sys.difference, this, this.heap ); - /** - * This method gets all but the first values of array - * @param {number=} n The numer of items to return - * @returns {*} - */ - this.tail = sys.bind( sys.tail, this, this.heap ); - /** - * Gets the first n values of the array - * @param {number=} n The numer of items to return - * @returns {*} - */ - this.head = sys.bind( sys.head, this, this.heap ); - }, - /** - * Adds to the top of the collection - * @param {*} item The item to add to the collection. Only one item at a time can be added - */ - add : function ( item ) { - this.heap.unshift( item ); - }, - /** - * Add to the bottom of the list - * @param {*} item The item to add to the collection. Only one item at a time can be added - */ - append : function ( item ) { - this.heap.push( item ); - }, - /** - * Add an item to the top of the list. This is identical to `add`, but is provided for stack semantics - * @param {*} item The item to add to the collection. Only one item at a time can be added - */ - push : function ( item ) { - this.add( item ); - }, - /** - * Modifies the collection with all falsey values of array removed. The values false, null, 0, "", undefined and NaN are all falsey. - */ - compact : function () { - this.heap = sys.compact( this.heap ); - }, - /** - * Creates an array of elements from the specified indexes, or keys, of the collection. Indexes may be specified as - * individual arguments or as arrays of indexes - * @param {indexes} args The indexes to use - */ - at : function () { - var arr = sys.toArray( arguments ); - arr.unshift( this.heap ); - return sys.at.apply( this, arr ); - }, - /** - * Flattens a nested array (the nesting can be to any depth). If isShallow is truthy, array will only be flattened a single level. - * If callback is passed, each element of array is passed through a callback before flattening. - * @param {object=} query A query to evaluate . If you pass in a query, only the items that match the query - * are iterated over. - * @param {function(value, key, collection)} iterator, - * @param {object=} thisobj The value of `this` - * @return {number} - */ - flatten : function ( query, iterator, thisobj ) { - if ( sys.isPlainObject( query ) ) { - thisobj = thisobj || this; - return sys.flatten( this.find( query ), iterator, thisobj ); - } else { - thisobj = iterator || this; - return sys.flatten( this.heap, query, thisobj ); - } - }, - /** - * Gets an items by its index - * @param {number} key The index to get - * @return {*} - */ - index : function ( index ) { - return this.heap[ index ]; - } - } -); - -/** - Collect an object - @param {array|object} obj What to collect - @return {ACollector|OCollector} - */ -exports.collect = function ( obj ) { - if ( sys.isArray( obj ) ) { - return new ACollector( obj ); - } else { - return new OCollector( obj ); - } -}; - -exports.array = function ( obj ) { - return new ACollector( obj ); -}; - -exports.object = function ( obj ) { - return new OCollector( obj ); -}; - -/** - Returns true if all items match the query. Aliases as `all` - @function - - @param {object} qu The query to execute - @returns {boolean} - @name every - @memberOf module:documents/collector~CollectorBase# - */ - - -/** - Returns true if any of the items match the query. Aliases as `any` - @function - - @param {object} qu The query to execute - @returns {boolean} - @memberOf module:documents/collector~CollectorBase# - @name some - */ - - -/** - Returns the set of unique records that match a query - - @param {object} qu The query to execute. - @return {array} - @memberOf module:documents/collector~CollectorBase# - @name unique - @method - **/ - -/** - Returns true if all items match the query. Aliases as `every` - @function - - @param {object} qu The query to execute - @returns {boolean} - @name all - @memberOf module:documents/collector~CollectorBase# - */ - - -/** - Returns true if any of the items match the query. Aliases as `all` - @function - - @param {object} qu The query to execute - @returns {boolean} - @memberOf module:documents/collector~CollectorBase# - @name any - */ - - -/** - Remove all items in the object/array that match the query - - @param {object} qu The query to execute. See {@link module:ink/probe.queryOperators} for the operators you can use. - @return {object|array} The array or object as appropriate without the records. - @memberOf module:documents/collector~CollectorBase# - @name remove - @method - **/ - -/** - Returns the first record that matches the query and returns its key or index depending on whether `obj` is an object or array respectively. - Aliased as `seekKey`. - - @param {object} qu The query to execute. - @returns {object} - @memberOf module:documents/collector~CollectorBase# - @name findOneKey - @method - */ - - -/** - Returns the first record that matches the query. Aliased as `seek`. - - @param {object} qu The query to execute. - @returns {object} - @memberOf module:documents/collector~CollectorBase# - @name findOne - @method - */ - - -/** - Find all records that match a query and returns the keys for those items. This is similar to {@link module:ink/probe.find} but instead of returning - records, returns the keys. If `obj` is an object it will return the hash key. If 'obj' is an array, it will return the index - - @param {object} qu The query to execute. - @returns {array} - @memberOf module:documents/collector~CollectorBase# - @name findKeys - @method - */ - - -/** - Find all records that match a query - - @param {object} qu The query to execute. - @returns {array} The results - @memberOf module:documents/collector~CollectorBase# - @name find - @method - **/ - -/** - Updates all records in obj that match the query. See {@link module:ink/probe.updateOperators} for the operators that are supported. - - @param {object} qu The query which will be used to identify the records to updated - @param {object} setDocument The update operator. See {@link module:ink/probe.updateOperators} - @memberOf module:documents/collector~CollectorBase# - @name update - @method - */ +"use strict"; +/** + @fileOverview An object and array collector + @module ink/collector + */ + +var probe = require("ink-probe"); +var sys = require("lodash"); +var dcl = require("dcl"); + +/** + * A collector + * @constructor + */ +var CollectorBase = dcl(Destroyable, { + declaredClass: "CollectorBase", + constructor: function (obj) { + var that = this; + if (obj && !sys.isObject(obj)) { + throw new TypeError("Collectors require an initial object or array passed to the constructor"); + } + /** + * The collection that being managed + * @type {object|array} + */ + this.heap = obj || {}; + // mixin the probe + probe.mixTo(this, this.heap); + /** + * Get the size of the collection + * @name length + * @type {number} + * @memberOf module:documents/collector~CollectorBase# + */ + Object.defineProperty(this, "length", { + get: function () { + return sys.size(that.heap); + }, + }); + /** + * Creates an array of shuffled array values, using a version of the Fisher-Yates shuffle. + * See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * @function + * @memberOf module:documents/collector~CollectorBase# + * @returns {array} + */ + this.shuffle = sys.bind(sys.shuffle, this, this.heap); + }, + /** + * Adds an item to the collection + * @param {*} key The key to use for the item being added. + * @param {*} item The item to add to the collection. The item is not iterated so that you could add bundled items to the collection + */ + add: function (key, item) { + this.heap[key] = item; + }, + /** + * Iterate over each item in the collection, or a subset that matches a query. This supports two signatures: + * `.each(query, function)` and `.each(function)`. If you pass in a query, only the items that match the query + * are iterated over. + * @param {object=} query A query to evaluate + * @param {function(val, key)} iterator Function to execute against each item in the collection + * @param {object=} thisobj The value of `this` + */ + each: function (query, iterator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + sys.each(this.find(query), iterator, thisobj); + } else { + thisobj = iterator || this; + sys.each(this.heap, query, thisobj); + } + }, + /** + * Returns the collection as an array. If it is already an array, it just returns that. + * @return {array} + */ + toArray: function () { + return sys.toArray(this.heap); + }, + /** + * Supports conversion to a JSON string or for passing over the wire + * @return {object} + * @returns {Object|array} + */ + toJSON: function () { + return this.heap; + }, + /** + * Maps the contents to an array by iterating over it and transforming it. You supply the iterator. Supports two signatures: + * `.map(query, function)` and `.map(function)`. If you pass in a query, only the items that match the query + * are iterated over. + * @param {object=} query A query to evaluate + * @param {function(val, key)} iterator Function to execute against each item in the collection + * @param {object=} thisobj The value of `this` + */ + map: function (query, iterator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + return sys.map(this.find(query), iterator, thisobj); + } else { + thisobj = iterator || this; + return sys.map(this.heap, query, thisobj); + } + }, + /** + * Reduces a collection to a value which is the accumulated result of running each element in the collection through the + * callback, where each successive callback execution consumes the return value of the previous execution. If accumulator + * is not passed, the first element of the collection will be used as the initial accumulator value. + * are iterated over. + * @param {object=} query A query to evaluate + * @param {function(result, val, key)} iterator The function that will be executed in each item in the collection + * @param {*=} accumulator Initial value of the accumulator. + * @param {object=} thisobj The value of `this` + * @return {*} + */ + reduce: function (query, iterator, accumulator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + return sys.reduce(this.find(query), iterator, accumulator, thisobj); + } else { + thisobj = accumulator || this; + return sys.reduce(this.heap, query, iterator, thisobj); + } + }, + /** + * Creates an object composed of keys returned from running each element + * of the collection through the given callback. The corresponding value of each key + * is the number of times the key was returned by the callback. + * @param {object=} query A query to evaluate. If you pass in a query, only the items that match the query + * are iterated over. + * @param {function(value, key, collection)} iterator + * @param {object=} thisobj The value of `this` + * @return {object} + */ + countBy: function (query, iterator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + return sys.countBy(this.find(query), iterator, thisobj); + } else { + thisobj = iterator || this; + return sys.countBy(this.heap, query, thisobj); + } + }, + /** + * Creates an object composed of keys returned from running each element of the collection through the callback. + * The corresponding value of each key is an array of elements passed to callback that returned the key. + * The callback is invoked with three arguments: (value, index|key, collection). + * @param {object=} query A query to evaluate . If you pass in a query, only the items that match the query + * are iterated over. + * @param {function(value, key, collection)} iterator + * @param {object=} thisobj The value of `this` + * @return {object} + */ + groupBy: function (query, iterator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + return sys.groupBy(this.find(query), iterator, thisobj); + } else { + thisobj = iterator || this; + return sys.groupBy(this.heap, query, thisobj); + } + }, + /** + * Reduce the collection to a single value. Supports two signatures: + * `.pluck(query, function)` and `.pluck(function)` + * @param {object=} query The query to evaluate. If you pass in a query, only the items that match the query + * are iterated over. + * @param {string} property The property that will be 'plucked' from the contents of the collection + * @return {*} + */ + pluck: function (query, property) { + if (arguments.length === 2) { + return sys.map(this.find(query), function (record) { + return probe.get(record, property); + }); + } else { + return sys.map(this.heap, function (record) { + return probe.get(record, query); + }); + } + }, + /** + * Returns a sorted copy of the collection. + * @param {object=} query The query to evaluate. If you pass in a query, only the items that match the query + * are iterated over. + * @param {function(value, key)} iterator + * @param {object=} thisobj The value of `this` + * @return {array} + */ + sortBy: function (query, iterator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + return sys.sortBy(this.find(query), iterator, thisobj); + } else { + thisobj = iterator || this; + return sys.sortBy(this.heap, query, thisobj); + } + }, + /** + * Retrieves the maximum value of an array. If callback is passed, + * it will be executed for each value in the array to generate the criterion by which the value is ranked. + * @param {object=} query A query to evaluate . If you pass in a query, only the items that match the query + * are iterated over. + * @param {function(value, key, collection)} iterator + * @param {object=} thisobj The value of `this` + * @return {number} + */ + max: function (query, iterator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + return sys.max(this.find(query), iterator, thisobj); + } else { + thisobj = iterator || this; + return sys.max(this.heap, query, thisobj); + } + }, + /** + * Retrieves the minimum value of an array. If callback is passed, + * it will be executed for each value in the array to generate the criterion by which the value is ranked. + * @param {object=} query A query to evaluate . If you pass in a query, only the items that match the query + * are iterated over. + * @param {function(value, key, collection)} iterator + * @param {object=} thisobj The value of `this` + * @return {number} + */ + min: function (query, iterator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + return sys.min(this.find(query), iterator, thisobj); + } else { + thisobj = iterator || this; + return sys.min(this.heap, query, thisobj); + } + }, + /** + * Destructor called when the object is destroyed. + */ + destroy: function () { + this.heap = null; + }, +}); + +/** + * An object based collector + * @extends module:documents/collector~CollectorBase + * @constructor + */ +var OCollector = dcl(CollectorBase, { + /** + * Get a record by key + * @param {*} key The key of the record to get + * @return {*} + */ + key: function (key) { + return this.heap[key]; + }, +}); + +//noinspection JSCommentMatchesSignature +/** + An array based collector + @extends module:documents/collector~CollectorBase + @constructor + */ +var ACollector = dcl(CollectorBase, { + constructor: function (obj) { + if (obj && !sys.isArray(obj)) { + throw new TypeError("Collectors require an array passed to the constructor"); + } + this.heap = obj || []; + /** + * Creates an array of array elements not present in the other arrays using strict equality for comparisons, i.e. ===. + * @returns {array} + */ + this.difference = sys.bind(sys.difference, this, this.heap); + /** + * This method gets all but the first values of array + * @param {number=} n The numer of items to return + * @returns {*} + */ + this.tail = sys.bind(sys.tail, this, this.heap); + /** + * Gets the first n values of the array + * @param {number=} n The numer of items to return + * @returns {*} + */ + this.head = sys.bind(sys.head, this, this.heap); + }, + /** + * Adds to the top of the collection + * @param {*} item The item to add to the collection. Only one item at a time can be added + */ + add: function (item) { + this.heap.unshift(item); + }, + /** + * Add to the bottom of the list + * @param {*} item The item to add to the collection. Only one item at a time can be added + */ + append: function (item) { + this.heap.push(item); + }, + /** + * Add an item to the top of the list. This is identical to `add`, but is provided for stack semantics + * @param {*} item The item to add to the collection. Only one item at a time can be added + */ + push: function (item) { + this.add(item); + }, + /** + * Modifies the collection with all falsey values of array removed. The values false, null, 0, "", undefined and NaN are all falsey. + */ + compact: function () { + this.heap = sys.compact(this.heap); + }, + /** + * Creates an array of elements from the specified indexes, or keys, of the collection. Indexes may be specified as + * individual arguments or as arrays of indexes + * @param {indexes} args The indexes to use + */ + at: function () { + var arr = sys.toArray(arguments); + arr.unshift(this.heap); + return sys.at.apply(this, arr); + }, + /** + * Flattens a nested array (the nesting can be to any depth). If isShallow is truthy, array will only be flattened a single level. + * If callback is passed, each element of array is passed through a callback before flattening. + * @param {object=} query A query to evaluate . If you pass in a query, only the items that match the query + * are iterated over. + * @param {function(value, key, collection)} iterator, + * @param {object=} thisobj The value of `this` + * @return {number} + */ + flatten: function (query, iterator, thisobj) { + if (sys.isPlainObject(query)) { + thisobj = thisobj || this; + return sys.flatten(this.find(query), iterator, thisobj); + } else { + thisobj = iterator || this; + return sys.flatten(this.heap, query, thisobj); + } + }, + /** + * Gets an items by its index + * @param {number} key The index to get + * @return {*} + */ + index: function (index) { + return this.heap[index]; + }, +}); + +/** + Collect an object + @param {array|object} obj What to collect + @return {ACollector|OCollector} + */ +exports.collect = function (obj) { + if (sys.isArray(obj)) { + return new ACollector(obj); + } else { + return new OCollector(obj); + } +}; + +exports.array = function (obj) { + return new ACollector(obj); +}; + +exports.object = function (obj) { + return new OCollector(obj); +}; + +/** + Returns true if all items match the query. Aliases as `all` + @function + + @param {object} qu The query to execute + @returns {boolean} + @name every + @memberOf module:documents/collector~CollectorBase# + */ + +/** + Returns true if any of the items match the query. Aliases as `any` + @function + + @param {object} qu The query to execute + @returns {boolean} + @memberOf module:documents/collector~CollectorBase# + @name some + */ + +/** + Returns the set of unique records that match a query + + @param {object} qu The query to execute. + @return {array} + @memberOf module:documents/collector~CollectorBase# + @name unique + @method + **/ + +/** + Returns true if all items match the query. Aliases as `every` + @function + + @param {object} qu The query to execute + @returns {boolean} + @name all + @memberOf module:documents/collector~CollectorBase# + */ + +/** + Returns true if any of the items match the query. Aliases as `all` + @function + + @param {object} qu The query to execute + @returns {boolean} + @memberOf module:documents/collector~CollectorBase# + @name any + */ + +/** + Remove all items in the object/array that match the query + + @param {object} qu The query to execute. See {@link module:ink/probe.queryOperators} for the operators you can use. + @return {object|array} The array or object as appropriate without the records. + @memberOf module:documents/collector~CollectorBase# + @name remove + @method + **/ + +/** + Returns the first record that matches the query and returns its key or index depending on whether `obj` is an object or array respectively. + Aliased as `seekKey`. + + @param {object} qu The query to execute. + @returns {object} + @memberOf module:documents/collector~CollectorBase# + @name findOneKey + @method + */ + +/** + Returns the first record that matches the query. Aliased as `seek`. + + @param {object} qu The query to execute. + @returns {object} + @memberOf module:documents/collector~CollectorBase# + @name findOne + @method + */ + +/** + Find all records that match a query and returns the keys for those items. This is similar to {@link module:ink/probe.find} but instead of returning + records, returns the keys. If `obj` is an object it will return the hash key. If 'obj' is an array, it will return the index + + @param {object} qu The query to execute. + @returns {array} + @memberOf module:documents/collector~CollectorBase# + @name findKeys + @method + */ + +/** + Find all records that match a query + + @param {object} qu The query to execute. + @returns {array} The results + @memberOf module:documents/collector~CollectorBase# + @name find + @method + **/ + +/** + Updates all records in obj that match the query. See {@link module:ink/probe.updateOperators} for the operators that are supported. + + @param {object} qu The query which will be used to identify the records to updated + @param {object} setDocument The update operator. See {@link module:ink/probe.updateOperators} + @memberOf module:documents/collector~CollectorBase# + @name update + @method + */ diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/model.js b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/model.js index 30941d0..50c1fe6 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/model.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/model.js @@ -1,117 +1,120 @@ -"use strict"; -/** - * @fileOverview A model is the first level if usable data-bearing entity in the system. It does NOT include any verbs for saving or anything like - * that, it is a pure, in memory data container - * @module documents/model - * @require base - * @require documents/probe - * @require lodash - */ - -var Base = require( "../base" ); -var probe = require( "./probe" ); -var sys = require( "lodash" ); -/** - * A model is the first level if usable data-bearing entity in the system. It does NOT include any verbs for saving or anything like - * that, it is a pure, in memory data container - * @exports documents/model - * @constructor - * @borrows module:documents/probe.get as get - * @borrows module:documents/probe.set as set - * @borrows module:documents/probe.any as any - * @borrows module:documents/probe.all as all - * @borrows module:documents/probe.remove as remove - * @borrows module:documents/probe.seekKey as seekKey - * @borrows module:documents/probe.seek as seek - * @borrows module:documents/probe.findOne as findOne - * @borrows module:documents/probe.findOneKey as findOneKey - * @borrows module:documents/probe.findKeys as findKeys - * @borrows module:documents/probe.find as find - * @borrows module:documents/probe.update as update - * @borrows module:documents/probe.some as some - * @borrows module:documents/probe.every as every - */ -var Model = Base.compose( [Base], /** @lends documents/model# */{ - constructor : function () { - var that = this; - probe.mixin( this ); - - var idField = "_id"; - /** - * The name of the field that uniquely identifies a record. When provided, some operations will take advantage of it - * - * @name _idField - * @memberOf documents/model# - * @type {string} - * @private - */ - Object.defineProperty( this, "_idField", { - get : function () { - return idField; - }, - set : function ( val ) { - idField = val; - }, - configurable : false, - enumerable : true, - writable : true - } ); - - /** - * The value of the primary key if {@link documents/model#_idField} is filled in. It will be null if none found - * - * @name _pkey - * @memberOf documents/model# - * @type {*} - * @private - */ - Object.defineProperty( this, "_pkey", { - get : function () { - var val; - if ( !sys.isEmpty( that._idField ) ) { - val = that[that._idField]; - } - return val; - }, - set : function ( val ) { - if ( !sys.isEmpty( that._idField ) ) { - that[that._idField] = val; - } - }, - configurable : false, - enumerable : true, - writable : true - } ); - - /** - * If {@link documents/model#_idField} is filled in and it's value is empty this will be true. - * @type {boolean} - * @name isNew - * @memberOf documents/model# - */ - Object.defineProperty( this, "isNew", { - get : function () { - return !sys.isEmpty( that._idField ) && !sys.isEmpty( that[that._idField] ) - }, - configurable : false, - enumerable : true, - writable : false - } ); - - /** - * Returns true if this instance is empty - * @type {boolean} - * @name isEmpty - * @memberOf documents/model# - */ - Object.defineProperty( this, "isEmpty", { - get : function () { - return sys.isEmpty( that ); - }, - configurable : false, - enumerable : true, - writable : false - } ); - } -} ); -module.exports = Model; +"use strict"; +/** + * @fileOverview A model is the first level if usable data-bearing entity in the system. It does NOT include any verbs for saving or anything like + * that, it is a pure, in memory data container + * @module documents/model + * @require base + * @require documents/probe + * @require lodash + */ + +var Base = require("../base"); +var probe = require("./probe"); +var sys = require("lodash"); +/** + * A model is the first level if usable data-bearing entity in the system. It does NOT include any verbs for saving or anything like + * that, it is a pure, in memory data container + * @exports documents/model + * @constructor + * @borrows module:documents/probe.get as get + * @borrows module:documents/probe.set as set + * @borrows module:documents/probe.any as any + * @borrows module:documents/probe.all as all + * @borrows module:documents/probe.remove as remove + * @borrows module:documents/probe.seekKey as seekKey + * @borrows module:documents/probe.seek as seek + * @borrows module:documents/probe.findOne as findOne + * @borrows module:documents/probe.findOneKey as findOneKey + * @borrows module:documents/probe.findKeys as findKeys + * @borrows module:documents/probe.find as find + * @borrows module:documents/probe.update as update + * @borrows module:documents/probe.some as some + * @borrows module:documents/probe.every as every + */ +var Model = Base.compose( + [Base], + /** @lends documents/model# */ { + constructor: function () { + var that = this; + probe.mixin(this); + + var idField = "_id"; + /** + * The name of the field that uniquely identifies a record. When provided, some operations will take advantage of it + * + * @name _idField + * @memberOf documents/model# + * @type {string} + * @private + */ + Object.defineProperty(this, "_idField", { + get: function () { + return idField; + }, + set: function (val) { + idField = val; + }, + configurable: false, + enumerable: true, + writable: true, + }); + + /** + * The value of the primary key if {@link documents/model#_idField} is filled in. It will be null if none found + * + * @name _pkey + * @memberOf documents/model# + * @type {*} + * @private + */ + Object.defineProperty(this, "_pkey", { + get: function () { + var val; + if (!sys.isEmpty(that._idField)) { + val = that[that._idField]; + } + return val; + }, + set: function (val) { + if (!sys.isEmpty(that._idField)) { + that[that._idField] = val; + } + }, + configurable: false, + enumerable: true, + writable: true, + }); + + /** + * If {@link documents/model#_idField} is filled in and it's value is empty this will be true. + * @type {boolean} + * @name isNew + * @memberOf documents/model# + */ + Object.defineProperty(this, "isNew", { + get: function () { + return !sys.isEmpty(that._idField) && !sys.isEmpty(that[that._idField]); + }, + configurable: false, + enumerable: true, + writable: false, + }); + + /** + * Returns true if this instance is empty + * @type {boolean} + * @name isEmpty + * @memberOf documents/model# + */ + Object.defineProperty(this, "isEmpty", { + get: function () { + return sys.isEmpty(that); + }, + configurable: false, + enumerable: true, + writable: false, + }); + }, + } +); +module.exports = Model; diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/probe.js b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/probe.js index b699e31..fcc626c 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/probe.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/probe.js @@ -1,1013 +1,1012 @@ -"use strict"; -/** - @fileOverview Queries objects in memory using a mongo-like notation for reaching into objects and filtering for records - - @module documents/probe - @author Terry Weiss - @license MIT - @requires lodash - */ - -var sys = require( "lodash" ); -/** - The list of operators that are nested within the expression object. These take the form {path:{operator:operand}} - @private - @type {array.} - **/ -var nestedOps = ["$eq", "$gt", "$gte", "$in", "$lt", "$lte", "$ne", "$nin", "$exists", "$mod", "$size", "$all"]; - -/** - The list of operators that prefix the expression object. These take the form {operator:{operands}} or {operator: [operands]} - @private - @type {array.} - **/ -var prefixOps = ["$and", "$or", "$nor", "$not"]; - -/** - Processes a nested operator by picking the operator out of the expression object. Returns a formatted object that can be used for querying - @private - @param {string} path The path to element to work with - @param {object} operand The operands to use for the query - @return {object} A formatted operation definition - **/ -function processNestedOperator( path, operand ) { - var opKeys = Object.keys( operand ); - return { - operation : opKeys[ 0 ], - operands : [operand[ opKeys[ 0 ] ]], - path : path - }; -} - -/** - Interrogates a single query expression object and calls the appropriate handler for its contents - @private - @param {object} val The expression - @param {object} key The prefix - @returns {object} A formatted operation definition - **/ -function processExpressionObject( val, key ) { - var operator; - if ( sys.isObject( val ) ) { - var opKeys = Object.keys( val ); - var op = opKeys[ 0 ]; - - if ( sys.indexOf( nestedOps, op ) > -1 ) { - operator = processNestedOperator( key, val ); - } else if ( sys.indexOf( prefixOps, key ) > -1 ) { - operator = processPrefixOperator( key, val ); - } else if ( op === "$regex" ) { - // special handling for regex options - operator = processNestedOperator( key, val ); - } else if ( op === "$elemMatch" ) { - // elemMatch is just a weird duck - operator = { - path : key, - operation : op, - operands : [] - }; - sys.each( val[ op ], function ( entry ) { - operator.operands = parseQueryExpression( entry ); - } ); - } - else { - throw new Error( "Unrecognized operator" ); - } - } else { - operator = processNestedOperator( key, { $eq : val } ); - } - return operator; -} - -/** - Processes a prefixed operator and then passes control to the nested operator method to pick out the contained values - @private - @param {string} operation The operation prefix - @param {object} operand The operands to use for the query - @return {object} A formatted operation definition - **/ -function processPrefixOperator( operation, operand ) { - var component = { - operation : operation, - path : null, - operands : [] - }; - - if ( sys.isArray( operand ) ) { - //if it is an array we need to loop through the array and parse each operand - //if it is an array we need to loop through the array and parse each operand - sys.each( operand, function ( obj ) { - sys.each( obj, function ( val, key ) { - component.operands.push( processExpressionObject( val, key ) ); - } ); - } ); - } else { - //otherwise it is an object and we can parse it directly - sys.each( operand, function ( val, key ) { - component.operands.push( processExpressionObject( val, key ) ); - } ); - } - return component; - -} - -/** - Parses a query request and builds an object that can used to process a query target - @private - @param {object} obj The expression object - @returns {object} All components of the expression in a kind of execution tree - **/ - -function parseQueryExpression( obj ) { - if ( sys.size( obj ) > 1 ) { - var arr = sys.map( obj, function ( v, k ) { - var entry = {}; - entry[k] = v; - return entry; - } ); - obj = { - $and : arr - }; - } - var payload = []; - sys.each( obj, function ( val, key ) { - - var exprObj = processExpressionObject( val, key ); - - if ( exprObj.operation === "$regex" ) { - exprObj.options = val.$options; - } - - payload.push( exprObj ); - } ); - - return payload; -} - -/** - The delimiter to use when splitting an expression - @type {string} - @static - @default '.' - **/ - -exports.delimiter = '.'; - -/** - Splits a path expression into its component parts - @private - @param {string} path The path to split - @returns {array} - **/ - -function splitPath( path ) { - return path.split( exports.delimiter ); -} - -/** - Reaches into an object and allows you to get at a value deeply nested in an object - @private - @param {array} path The split path of the element to work with - @param {object} record The record to reach into - @return {*} Whatever was found in the record - **/ -function reachin( path, record ) { - var context = record; - var part; - var _i; - var _len; - - for ( _i = 0, _len = path.length; _i < _len; _i++ ) { - part = path[_i]; - context = context[part]; - if ( sys.isNull( context ) || sys.isUndefined( context ) ) { - break; - } - } - - return context; -} - -/** - This will write the value into a record at the path, creating intervening objects if they don't exist - @private - @param {array} path The split path of the element to work with - @param {object} record The record to reach into - @param {string} setter The set command, defaults to $set - @param {object} newValue The value to write to the, or if the operator is $pull, the query of items to look for - */ -function pushin( path, record, setter, newValue ) { - var context = record; - var parent = record; - var lastPart = null; - var _i; - var _len; - var part; - var keys; - - for ( _i = 0, _len = path.length; _i < _len; _i++ ) { - part = path[_i]; - lastPart = part; - parent = context; - context = context[part]; - if ( sys.isNull( context ) || sys.isUndefined( context ) ) { - parent[part] = {}; - context = parent[part]; - } - } - - if ( sys.isEmpty( setter ) || setter === '$set' ) { - parent[lastPart] = newValue; - return parent[lastPart]; - } else { - switch ( setter ) { - case '$inc': - /** - * Increments a field by the amount you specify. It takes the form - * `{ $inc: { field1: amount } }` - * @name $inc - * @memberOf module:documents/probe.updateOperators - * @example - * var probe = require("documents/probe"); - * probe.update( obj, {'name.last' : 'Owen', 'name.first' : 'LeRoy'}, - * {$inc : {'password.changes' : 2}} ); - */ - - if ( !sys.isNumber( newValue ) ) { - newValue = 1; - } - if ( sys.isNumber( parent[lastPart] ) ) { - parent[lastPart] = parent[lastPart] + newValue; - return parent[lastPart]; - } - break; - case '$dec': - /** - * Decrements a field by the amount you specify. It takes the form - * `{ $dec: { field1: amount }` - * @name $dec - * @memberOf module:documents/probe.updateOperators - * @example - * var probe = require("documents/probe"); - * probe.update( obj, {'name.last' : 'Owen', 'name.first' : 'LeRoy'}, - * {$dec : {'password.changes' : 2}} ); - */ - - if ( !sys.isNumber( newValue ) ) { - newValue = 1; - } - if ( sys.isNumber( parent[lastPart] ) ) { - parent[lastPart] = parent[lastPart] - newValue; - return parent[lastPart]; - } - break; - case '$unset': - /** - * Removes the field from the object. It takes the form - * `{ $unset: { field1: "" } }` - * @name $unset - * @memberOf module:documents/probe.updateOperators - * @example - * var probe = require("documents/probe"); - * probe.update( data, {'name.first' : 'Yogi'}, {$unset : {'name.first' : ''}} ); - */ - - return delete parent[lastPart]; - case '$pop': - /** - * The $pop operator removes the first or last element of an array. Pass $pop a value of 1 to remove the last element - * in an array and a value of -1 to remove the first element of an array. This will only work on arrays. Syntax: - * `{ $pop: { field: 1 } }` or `{ $pop: { field: -1 } }` - * @name $pop - * @memberOf module:documents/probe.updateOperators - * @example - * var probe = require("documents/probe"); - * // attr is the name of the array field - * probe.update( data, {_id : '511d18827da2b88b09000133'}, {$pop : {attr : 1}} ); - */ - - if ( sys.isArray( parent[lastPart] ) ) { - if ( !sys.isNumber( newValue ) ) { - newValue = 1; - } - if ( newValue === 1 ) { - return parent[lastPart].pop(); - } else { - return parent[lastPart].shift(); - } - } - break; - case '$push': - /** - * The $push operator appends a specified value to an array. It looks like this: - * `{ $push: { : } }` - * @name $push - * @memberOf module:documents/probe.updateOperators - * @example - * var probe = require("documents/probe"); - * // attr is the name of the array field - * probe.update( data, {_id : '511d18827da2b88b09000133'}, - * {$push : {attr : {"hand" : "new", "color" : "new"}}} ); - */ - - if ( sys.isArray( parent[lastPart] ) ) { - return parent[lastPart].push( newValue ); - } - break; - case '$pull': - /** - * The $pull operator removes all instances of a value from an existing array. It looks like this: - * `{ $pull: { field: } }` - * @name $pull - * @memberOf module:documents/probe.updateOperators - * @example - * var probe = require("documents/probe"); - * // attr is the name of the array field - * probe.update( data, {'email' : 'EWallace.43@fauxprisons.com'}, - * {$pull : {attr : {"color" : "green"}}} ); - */ - - if ( sys.isArray( parent[lastPart] ) ) { - keys = exports.findKeys( parent[lastPart], newValue ); - sys.each( keys, function ( val, index ) { - return delete parent[lastPart][index]; - } ); - parent[lastPart] = sys.compact( parent[lastPart] ); - return parent[lastPart]; - } - } - } -} - -/** - The query operations that evaluate directly from an operation - @private - **/ -var operations = { - /** - * `$eq` performs a `===` comparison by comparing the value directly if it is an atomic value. - * otherwise if it is an array, it checks to see if the value looked for is in the array. - * `{field: value}` or `{field: {$eq : value}}` or `{array: value}` or `{array: {$eq : value}}` - * @name $eq - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {categories : "cat1"} ); - * // is the same as - * probe.find( data, {categories : {$eq: "cat1"}} ); - */ - - $eq : function ( qu, value ) { - if ( sys.isArray( value ) ) { - return sys.find( value, function ( entry ) { - return JSON.stringify( qu.operands[0] ) === JSON.stringify( entry ); - } ) !== void 0; - } else { - return JSON.stringify( qu.operands[0] ) === JSON.stringify( value ); - } - }, - /** - * `$ne` performs a `!==` comparison by comparing the value directly if it is an atomic value. Otherwise, if it is an array - * this is performs a "not in array". - * '{field: {$ne : value}}` or '{array: {$ne : value}}` - * @name $ne - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"name.first" : {$ne : "Sheryl"}} ); - */ - - $ne : function ( qu, value ) { - if ( sys.isArray( value ) ) { - return sys.find( value, function ( entry ) { - return JSON.stringify( qu.operands[0] ) !== JSON.stringify( entry ); - } ) !== void 0; - } else { - return JSON.stringify( qu.operands[0] ) !== JSON.stringify( value ); - } - }, - /** - * `$all` checks to see if all of the members of the query are included in an array - * `{array: {$all: [val1, val2, val3]}}` - * @name $all - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"categories" : {$all : ["cat4", "cat2", "cat1"]}} ); - */ - - $all : function ( qu, value ) { - var operands, result; - - result = false; - if ( sys.isArray( value ) ) { - operands = sys.flatten( qu.operands ); - result = sys.intersection( operands, value ).length === operands.length; - } - return result; - }, - /** - * `$gt` Sees if a field is greater than the value - * `{field: {$gt: value}}` - * @name $gt - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"age" : {$gt : 24}} ); - */ - - $gt : function ( qu, value ) { - return qu.operands[0] < value; - }, - /** - * `$gte` Sees if a field is greater than or equal to the value - * `{field: {$gte: value}}` - * @name $gte - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"age" : {$gte : 50}} ); - */ - - $gte : function ( qu, value ) { - return qu.operands[0] <= value; - }, - /** - * `$lt` Sees if a field is less than the value - * `{field: {$lt: value}}` - * @name $lt - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"age" : {$lt : 24}} ); - */ - - $lt : function ( qu, value ) { - return qu.operands[0] > value; - }, - /** - * `$lte` Sees if a field is less than or equal to the value - * `{field: {$lte: value}}` - * @name $lte - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"age" : {$lte : 50}} ); - */ - - $lte : function ( qu, value ) { - return qu.operands[0] >= value; - }, - /** - * `$in` Sees if a field has one of the values in the query - * `{field: {$in: [test1, test2, test3,...]}}` - * @name $in - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"age" : {$in : [24, 28, 60]}} ); - */ - - $in : function ( qu, value ) { - var operands; - - operands = sys.flatten( qu.operands ); - return sys.indexOf( operands, value ) > -1; - }, - /** - * `$nin` Sees if a field has none of the values in the query - * `{field: {$nin: [test1, test2, test3,...]}}` - * @name $nin - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"age" : {$nin : [24, 28, 60]}} ); - */ - - $nin : function ( qu, value ) { - var operands; - - operands = sys.flatten( qu.operands ); - return sys.indexOf( operands, value ) === -1; - }, - /** - * `$exists` Sees if a field exists. - * `{field: {$exists: true|false}}` - * @name $exists - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"name.middle" : {$exists : true}} ); - */ - - $exists : function ( qu, value ) { - return (sys.isNull( value ) || sys.isUndefined( value )) !== qu.operands[0]; - }, - /** - * Checks equality to a modulus operation on a field - * `{field: {$mod: [divisor, remainder]}}` - * @name $mod - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"age" : {$mod : [2, 0]}} ); - */ - - $mod : function ( qu, value ) { - var operands = sys.flatten( qu.operands ); - if ( operands.length !== 2 ) { - throw new Error( "$mod requires two operands" ); - } - var mod = operands[0]; - var rem = operands[1]; - return value % mod === rem; - }, - /** - * Compares the size of the field/array to the query. This can be used on arrays, strings and objects (where it will count keys) - * `{'field|array`: {$size: value}}` - * @name $size - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {attr : {$size : 3}} ); - */ - - $size : function ( qu, value ) { - return sys.size( value ) === qu.operands[0]; - }, - /** - * Performs a regular expression test againts the field - * `{field: {$regex: re, $options: reOptions}}` - * @name $regex - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {"name.first" : {$regex : "m*", $options : "i"}} ); - */ - - $regex : function ( qu, value ) { - var r = new RegExp( qu.operands[0], qu.options ); - return r.test( value ); - }, - /** - * This is like $all except that it works with an array of objects or value. It checks to see the array matches all - * of the conditions of the query - * `{array: {$elemMatch: {path: value, path: {$operation: value2}}}` - * @name $elemMatch - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {attr : {$elemMatch : [ - * {color : "red", "hand" : "left"} - * ]}} ); - */ - $elemMatch : function ( qu, value ) { - var expression, test, _i, _len; - - if ( sys.isArray( value ) ) { - var _ref = qu.operands; - for ( _i = 0, _len = _ref.length; _i < _len; _i++ ) { - expression = _ref[_i]; - if ( expression.path ) { - expression.splitPath = splitPath( expression.path ); - } - } - test = execQuery( value, qu.operands, null, true ).arrayResults; - } - return test.length > 0; - }, - /** - * Returns true if all of the conditions of the query are met - * `{$and: [query1, query2, query3]}` - * @name $and - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {$and : [ - * {"name.first" : "Mildred"}, - * {"name.last" : "Graves"} - * ]} ); - */ - - $and : function ( qu, value, record ) { - var isAnd = false; - - sys.each( qu.operands, function ( expr ) { - if ( expr.path ) { - expr.splitPath = expr.splitPath || splitPath( expr.path ); - } - var test = reachin( expr.splitPath, record, expr.operation ); - isAnd = operations[expr.operation]( expr, test, record ); - if ( !isAnd ) { - return false; - } - } ); - - return isAnd; - }, - /** - * Returns true if any of the conditions of the query are met - * `{$or: [query1, query2, query3]}` - * @name $or - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {$or : [ - * "age" : {$in : [24, 28, 60]}}, - * {categories : "cat1"} - * ]} ); - */ - $or : function ( qu, value, record ) { - var isOr = false; - sys.each( qu.operands, function ( expr ) { - if ( expr.path ) { - expr.splitPath = expr.splitPath || splitPath( expr.path ); - } - var test = reachin( expr.splitPath, record, expr.operation ); - isOr = operations[expr.operation]( expr, test, record ); - if ( isOr ) { - return false; - } - } ); - - return isOr; - }, - /** - * Returns true if none of the conditions of the query are met - * `{$nor: [query1, query2, query3]}` - * @name $nor - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {$nor : [ - * {"age" : {$in : [24, 28, 60]}}, - * {categories : "cat1"} - * ]} ); - */ - $nor : function ( qu, value, record ) { - var isOr = false; - sys.each( qu.operands, function ( expr ) { - if ( expr.path ) { - expr.splitPath = expr.splitPath || splitPath( expr.path ); - } - var test = reachin( expr.splitPath, record, expr.operation ); - isOr = operations[expr.operation]( expr, test, record ); - if ( isOr ) { - return false; - } - } ); - - return !isOr; - }, - /** - * Logical NOT on the conditions of the query - * `{$not: [query1, query2, query3]}` - * @name $not - * @memberOf module:documents/probe.queryOperators - * @example - * var probe = require("documents/probe"); - * probe.find( data, {$not : {"age" : {$lt : 24}}} ); - */ - $not : function ( qu, value, record ) { - - var result = false; - sys.each( qu.operands, function ( expr ) { - if ( expr.path ) { - expr.splitPath = expr.splitPath || splitPath( expr.path ); - } - var test = reachin( expr.splitPath, record, expr.operation ); - result = operations[expr.operation]( expr, test, record ); - if ( result ) { - return false; - } - } ); - - return !result; - - } -}; - -/** - Executes a query by traversing a document and evaluating each record - @private - @param {array|object} obj The object to query - @param {object} qu The query to execute - @param {?boolean} shortCircuit When true, the condition that matches the query stops evaluation for that record, otherwise all conditions have to be met - @param {?boolean} stopOnFirst When true all evaluation stops after the first record is found to match the conditons - **/ -function execQuery( obj, qu, shortCircuit, stopOnFirst ) { - var arrayResults = []; - var keyResults = []; - sys.each( obj, function ( record, key ) { - var expr, result, test, _i, _len; - - for ( _i = 0, _len = qu.length; _i < _len; _i++ ) { - expr = qu[_i]; - if ( expr.splitPath ) { - test = reachin( expr.splitPath, record, expr.operation ); - } - result = operations[expr.operation]( expr, test, record ); - if ( result ) { - arrayResults.push( record ); - keyResults.push( key ); - } - if ( !result && shortCircuit ) { - break; - } - } - if ( arrayResults.length > 0 && stopOnFirst ) { - return false; - } - } ); - return { - arrayResults : arrayResults, - keyResults : keyResults - }; -} - -/** - Updates all records in obj that match the query. See {@link module:documents/probe.updateOperators} for the operators that are supported. - @param {object|array} obj The object to update - @param {object} qu The query which will be used to identify the records to updated - @param {object} setDocument The update operator. See {@link module:documents/probe.updateOperators} - */ -exports.update = function ( obj, qu, setDocument ) { - var records = exports.find( obj, qu ); - return sys.each( records, function ( record ) { - return sys.each( setDocument, function ( fields, operator ) { - return sys.each( fields, function ( newValue, path ) { - return pushin( splitPath( path ), record, operator, newValue ); - } ); - } ); - } ); -}; -/** - Find all records that match a query - @param {array|object} obj The object to query - @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. - @returns {array} The results - **/ -exports.find = function ( obj, qu ) { - var expression, _i, _len; - - var query = parseQueryExpression( qu ); - for ( _i = 0, _len = query.length; _i < _len; _i++ ) { - expression = query[_i]; - if ( expression.path ) { - expression.splitPath = splitPath( expression.path ); - } - } - return execQuery( obj, query ).arrayResults; -}; -/** - Find all records that match a query and returns the keys for those items. This is similar to {@link module:documents/probe.find} but instead of returning - records, returns the keys. If `obj` is an object it will return the hash key. If 'obj' is an array, it will return the index - @param {array|object} obj The object to query - @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. - @returns {array} - */ -exports.findKeys = function ( obj, qu ) { - var expression, _i, _len; - - var query = parseQueryExpression( qu ); - for ( _i = 0, _len = query.length; _i < _len; _i++ ) { - expression = query[_i]; - if ( expression.path ) { - expression.splitPath = splitPath( expression.path ); - } - } - return execQuery( obj, query ).keyResults; -}; - -/** - Returns the first record that matches the query. Aliased as `seek`. - @param {array|object} obj The object to query - @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. - @returns {object} - */ -exports.findOne = function ( obj, qu ) { - var expression, _i, _len; - - var query = parseQueryExpression( qu ); - for ( _i = 0, _len = query.length; _i < _len; _i++ ) { - expression = query[_i]; - if ( expression.path ) { - expression.splitPath = splitPath( expression.path ); - } - } - var results = execQuery( obj, query, false, true ).arrayResults; - if ( results.length > 0 ) { - return results[0]; - } else { - return null; - } -}; -exports.seek = exports.findOne; -/** - Returns the first record that matches the query and returns its key or index depending on whether `obj` is an object or array respectively. - Aliased as `seekKey`. - @param {array|object} obj The object to query - @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. - @returns {object} - */ -exports.findOneKey = function ( obj, qu ) { - var expression, _i, _len; - - var query = parseQueryExpression( qu ); - for ( _i = 0, _len = query.length; _i < _len; _i++ ) { - expression = query[_i]; - if ( expression.path ) { - expression.splitPath = splitPath( expression.path ); - } - } - var results = execQuery( obj, query, false, true ).keyResults; - if ( results.length > 0 ) { - return results[0]; - } else { - return null; - } -}; -exports.seekKey = exports.findOneKey; - -/** - Remove all items in the object/array that match the query - @param {array|object} obj The object to query - @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. - @return {object|array} The array or object as appropriate without the records. - **/ -exports.remove = function ( obj, qu ) { - var expression, _i, _len; - - var query = parseQueryExpression( qu ); - for ( _i = 0, _len = query.length; _i < _len; _i++ ) { - expression = query[_i]; - if ( expression.path ) { - expression.splitPath = splitPath( expression.path ); - } - } - var results = execQuery( obj, query, false, false ).keyResults; - if ( sys.isArray( obj ) ) { - var newArr = []; - sys.each( obj, function ( item, index ) { - if ( sys.indexOf( results, index ) === -1 ) { - return newArr.push( item ); - } - } ); - return newArr; - } else { - sys.each( results, function ( key ) { - return delete obj[key]; - } ); - return obj; - } -}; -/** - Returns true if all items match the query - - @param {array|object} obj The object to query - @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. - @returns {boolean} - **/ -exports.all = function ( obj, qu ) { - return exports.find( obj, qu ).length === sys.size( obj ); -}; - -/** - Returns true if any of the items match the query - - @param {array|object} obj The object to query - @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. - @returns {boolean} - **/ -exports.any = function ( obj, qu ) { - var expression, _i, _len; - - var query = parseQueryExpression( qu ); - for ( _i = 0, _len = query.length; _i < _len; _i++ ) { - expression = query[_i]; - if ( expression.path ) { - expression.splitPath = splitPath( expression.path ); - } - } - var results = execQuery( obj, query, true, true ).keyResults; - return results.length > 0; -}; - -/** - Returns the set of unique records that match a query - @param {array|object} obj The object to query - @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. - @return {array} - **/ -exports.unique = function ( obj, qu ) { - var test = exports.find( obj, qu ); - return sys.unique( test, function ( item ) { - return JSON.stringify( item ); - } ); -}; - -/** - This will write the value into a record at the path, creating intervening objects if they don't exist. This does not work as filtered - update and is meant to be used on a single record. It is a nice way of setting a property at an arbitrary depth at will. - - @param {array} path The split path of the element to work with - @param {object} record The record to reach into - @param {string} setter The set operation. See {@link module:documents/probe.updateOperators} for the operators you can use. - @param {object} newValue The value to write to the, or if the operator is $pull, the query of items to look for - */ -exports.set = function ( record, path, setter, newValue ) { - return pushin( splitPath( path ), record, setter, newValue ); -}; - -/** - Reaches into an object and allows you to get at a value deeply nested in an object. This is not a query, but a - straight reach in, useful for event bindings - - @param {array} path The split path of the element to work with - @param {object} record The record to reach into - @return {*} Whatever was found in the record - **/ -exports.get = function ( record, path ) { - return reachin( splitPath( path ), record ); -}; - -/** - Returns true if any of the items match the query. Aliases as `any` - @function - @param {array|object} obj The object to query - @param {object} qu The query to execute - @returns {boolean} - */ -exports.some = exports.any; - -/** - Returns true if all items match the query. Aliases as `all` - @function - @param {array|object} obj The object to query - @param {object} qu The query to execute - @returns {boolean} - */ -exports.every = exports.all; - -var bindables = { - any : exports.any, - all : exports.all, - remove : exports.remove, - seekKey : exports.seekKey, - seek : exports.seek, - findOneKey : exports.findOneKey, - findOne : exports.findOne, - findKeys : exports.findKeys, - find : exports.find, - update : exports.update, - some : exports.some, - every : exports.every, - "get" : exports.get, - "set" : exports.set -}; - -/** - Binds the query and update methods to a new object. When called these - methods can skip the first parameter so that find(object, query) can just be called as find(query) - @param {object|array} obj The object or array to bind to - @return {object} An object with method bindings in place - **/ -exports.proxy = function ( obj ) { - var retVal; - - retVal = {}; - sys.each( bindables, function ( val, key ) { - retVal[key] = sys.bind( val, obj, obj ); - } ); - return retVal; -}; - -/** - Binds the query and update methods to a specific object and adds the methods to that object. When called these - methods can skip the first parameter so that find(object, query) can just be called as object.find(query) - @param {object|array} obj The object or array to bind to - @param {object|array=} collection If the collection is not the same as this but is a property, or even - a whole other object, you specify that here. Otherwise the obj is assumed to be the same as the collecion - **/ -exports.mixin = function ( obj, collection ) { - collection = collection || obj; - return sys.each( bindables, function ( val, key ) { - obj[key] = sys.bind( val, obj, collection ); - } ); -}; - -/** - * These are the supported query operators - * - * @memberOf module:documents/probe - * @name queryOperators - * @class This is not actually a class, but an artifact of the documentation system - */ - -/** - * These are the supported update operators - * - * @memberOf module:documents/probe - * @name updateOperators - * @class This is not actually a class, but an artifact of the documentation system - */ +"use strict"; +/** + @fileOverview Queries objects in memory using a mongo-like notation for reaching into objects and filtering for records + + @module documents/probe + @author Terry Weiss + @license MIT + @requires lodash + */ + +var sys = require("lodash"); +/** + The list of operators that are nested within the expression object. These take the form {path:{operator:operand}} + @private + @type {array.} + **/ +var nestedOps = ["$eq", "$gt", "$gte", "$in", "$lt", "$lte", "$ne", "$nin", "$exists", "$mod", "$size", "$all"]; + +/** + The list of operators that prefix the expression object. These take the form {operator:{operands}} or {operator: [operands]} + @private + @type {array.} + **/ +var prefixOps = ["$and", "$or", "$nor", "$not"]; + +/** + Processes a nested operator by picking the operator out of the expression object. Returns a formatted object that can be used for querying + @private + @param {string} path The path to element to work with + @param {object} operand The operands to use for the query + @return {object} A formatted operation definition + **/ +function processNestedOperator(path, operand) { + var opKeys = Object.keys(operand); + return { + operation: opKeys[0], + operands: [operand[opKeys[0]]], + path: path, + }; +} + +/** + Interrogates a single query expression object and calls the appropriate handler for its contents + @private + @param {object} val The expression + @param {object} key The prefix + @returns {object} A formatted operation definition + **/ +function processExpressionObject(val, key) { + var operator; + if (sys.isObject(val)) { + var opKeys = Object.keys(val); + var op = opKeys[0]; + + if (sys.indexOf(nestedOps, op) > -1) { + operator = processNestedOperator(key, val); + } else if (sys.indexOf(prefixOps, key) > -1) { + operator = processPrefixOperator(key, val); + } else if (op === "$regex") { + // special handling for regex options + operator = processNestedOperator(key, val); + } else if (op === "$elemMatch") { + // elemMatch is just a weird duck + operator = { + path: key, + operation: op, + operands: [], + }; + sys.each(val[op], function (entry) { + operator.operands = parseQueryExpression(entry); + }); + } else { + throw new Error("Unrecognized operator"); + } + } else { + operator = processNestedOperator(key, { $eq: val }); + } + return operator; +} + +/** + Processes a prefixed operator and then passes control to the nested operator method to pick out the contained values + @private + @param {string} operation The operation prefix + @param {object} operand The operands to use for the query + @return {object} A formatted operation definition + **/ +function processPrefixOperator(operation, operand) { + var component = { + operation: operation, + path: null, + operands: [], + }; + + if (sys.isArray(operand)) { + //if it is an array we need to loop through the array and parse each operand + //if it is an array we need to loop through the array and parse each operand + sys.each(operand, function (obj) { + sys.each(obj, function (val, key) { + component.operands.push(processExpressionObject(val, key)); + }); + }); + } else { + //otherwise it is an object and we can parse it directly + sys.each(operand, function (val, key) { + component.operands.push(processExpressionObject(val, key)); + }); + } + return component; +} + +/** + Parses a query request and builds an object that can used to process a query target + @private + @param {object} obj The expression object + @returns {object} All components of the expression in a kind of execution tree + **/ + +function parseQueryExpression(obj) { + if (sys.size(obj) > 1) { + var arr = sys.map(obj, function (v, k) { + var entry = {}; + entry[k] = v; + return entry; + }); + obj = { + $and: arr, + }; + } + var payload = []; + sys.each(obj, function (val, key) { + var exprObj = processExpressionObject(val, key); + + if (exprObj.operation === "$regex") { + exprObj.options = val.$options; + } + + payload.push(exprObj); + }); + + return payload; +} + +/** + The delimiter to use when splitting an expression + @type {string} + @static + @default '.' + **/ + +exports.delimiter = "."; + +/** + Splits a path expression into its component parts + @private + @param {string} path The path to split + @returns {array} + **/ + +function splitPath(path) { + return path.split(exports.delimiter); +} + +/** + Reaches into an object and allows you to get at a value deeply nested in an object + @private + @param {array} path The split path of the element to work with + @param {object} record The record to reach into + @return {*} Whatever was found in the record + **/ +function reachin(path, record) { + var context = record; + var part; + var _i; + var _len; + + for (_i = 0, _len = path.length; _i < _len; _i++) { + part = path[_i]; + context = context[part]; + if (sys.isNull(context) || sys.isUndefined(context)) { + break; + } + } + + return context; +} + +/** + This will write the value into a record at the path, creating intervening objects if they don't exist + @private + @param {array} path The split path of the element to work with + @param {object} record The record to reach into + @param {string} setter The set command, defaults to $set + @param {object} newValue The value to write to the, or if the operator is $pull, the query of items to look for + */ +function pushin(path, record, setter, newValue) { + var context = record; + var parent = record; + var lastPart = null; + var _i; + var _len; + var part; + var keys; + + for (_i = 0, _len = path.length; _i < _len; _i++) { + part = path[_i]; + lastPart = part; + parent = context; + context = context[part]; + if (sys.isNull(context) || sys.isUndefined(context)) { + parent[part] = {}; + context = parent[part]; + } + } + + if (sys.isEmpty(setter) || setter === "$set") { + parent[lastPart] = newValue; + return parent[lastPart]; + } else { + switch (setter) { + case "$inc": + /** + * Increments a field by the amount you specify. It takes the form + * `{ $inc: { field1: amount } }` + * @name $inc + * @memberOf module:documents/probe.updateOperators + * @example + * var probe = require("documents/probe"); + * probe.update( obj, {'name.last' : 'Owen', 'name.first' : 'LeRoy'}, + * {$inc : {'password.changes' : 2}} ); + */ + + if (!sys.isNumber(newValue)) { + newValue = 1; + } + if (sys.isNumber(parent[lastPart])) { + parent[lastPart] = parent[lastPart] + newValue; + return parent[lastPart]; + } + break; + case "$dec": + /** + * Decrements a field by the amount you specify. It takes the form + * `{ $dec: { field1: amount }` + * @name $dec + * @memberOf module:documents/probe.updateOperators + * @example + * var probe = require("documents/probe"); + * probe.update( obj, {'name.last' : 'Owen', 'name.first' : 'LeRoy'}, + * {$dec : {'password.changes' : 2}} ); + */ + + if (!sys.isNumber(newValue)) { + newValue = 1; + } + if (sys.isNumber(parent[lastPart])) { + parent[lastPart] = parent[lastPart] - newValue; + return parent[lastPart]; + } + break; + case "$unset": + /** + * Removes the field from the object. It takes the form + * `{ $unset: { field1: "" } }` + * @name $unset + * @memberOf module:documents/probe.updateOperators + * @example + * var probe = require("documents/probe"); + * probe.update( data, {'name.first' : 'Yogi'}, {$unset : {'name.first' : ''}} ); + */ + + return delete parent[lastPart]; + case "$pop": + /** + * The $pop operator removes the first or last element of an array. Pass $pop a value of 1 to remove the last element + * in an array and a value of -1 to remove the first element of an array. This will only work on arrays. Syntax: + * `{ $pop: { field: 1 } }` or `{ $pop: { field: -1 } }` + * @name $pop + * @memberOf module:documents/probe.updateOperators + * @example + * var probe = require("documents/probe"); + * // attr is the name of the array field + * probe.update( data, {_id : '511d18827da2b88b09000133'}, {$pop : {attr : 1}} ); + */ + + if (sys.isArray(parent[lastPart])) { + if (!sys.isNumber(newValue)) { + newValue = 1; + } + if (newValue === 1) { + return parent[lastPart].pop(); + } else { + return parent[lastPart].shift(); + } + } + break; + case "$push": + /** + * The $push operator appends a specified value to an array. It looks like this: + * `{ $push: { : } }` + * @name $push + * @memberOf module:documents/probe.updateOperators + * @example + * var probe = require("documents/probe"); + * // attr is the name of the array field + * probe.update( data, {_id : '511d18827da2b88b09000133'}, + * {$push : {attr : {"hand" : "new", "color" : "new"}}} ); + */ + + if (sys.isArray(parent[lastPart])) { + return parent[lastPart].push(newValue); + } + break; + case "$pull": + /** + * The $pull operator removes all instances of a value from an existing array. It looks like this: + * `{ $pull: { field: } }` + * @name $pull + * @memberOf module:documents/probe.updateOperators + * @example + * var probe = require("documents/probe"); + * // attr is the name of the array field + * probe.update( data, {'email' : 'EWallace.43@fauxprisons.com'}, + * {$pull : {attr : {"color" : "green"}}} ); + */ + + if (sys.isArray(parent[lastPart])) { + keys = exports.findKeys(parent[lastPart], newValue); + sys.each(keys, function (val, index) { + return delete parent[lastPart][index]; + }); + parent[lastPart] = sys.compact(parent[lastPart]); + return parent[lastPart]; + } + } + } +} + +/** + The query operations that evaluate directly from an operation + @private + **/ +var operations = { + /** + * `$eq` performs a `===` comparison by comparing the value directly if it is an atomic value. + * otherwise if it is an array, it checks to see if the value looked for is in the array. + * `{field: value}` or `{field: {$eq : value}}` or `{array: value}` or `{array: {$eq : value}}` + * @name $eq + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {categories : "cat1"} ); + * // is the same as + * probe.find( data, {categories : {$eq: "cat1"}} ); + */ + + $eq: function (qu, value) { + if (sys.isArray(value)) { + return ( + sys.find(value, function (entry) { + return JSON.stringify(qu.operands[0]) === JSON.stringify(entry); + }) !== void 0 + ); + } else { + return JSON.stringify(qu.operands[0]) === JSON.stringify(value); + } + }, + /** + * `$ne` performs a `!==` comparison by comparing the value directly if it is an atomic value. Otherwise, if it is an array + * this is performs a "not in array". + * '{field: {$ne : value}}` or '{array: {$ne : value}}` + * @name $ne + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"name.first" : {$ne : "Sheryl"}} ); + */ + + $ne: function (qu, value) { + if (sys.isArray(value)) { + return ( + sys.find(value, function (entry) { + return JSON.stringify(qu.operands[0]) !== JSON.stringify(entry); + }) !== void 0 + ); + } else { + return JSON.stringify(qu.operands[0]) !== JSON.stringify(value); + } + }, + /** + * `$all` checks to see if all of the members of the query are included in an array + * `{array: {$all: [val1, val2, val3]}}` + * @name $all + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"categories" : {$all : ["cat4", "cat2", "cat1"]}} ); + */ + + $all: function (qu, value) { + var operands, result; + + result = false; + if (sys.isArray(value)) { + operands = sys.flatten(qu.operands); + result = sys.intersection(operands, value).length === operands.length; + } + return result; + }, + /** + * `$gt` Sees if a field is greater than the value + * `{field: {$gt: value}}` + * @name $gt + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"age" : {$gt : 24}} ); + */ + + $gt: function (qu, value) { + return qu.operands[0] < value; + }, + /** + * `$gte` Sees if a field is greater than or equal to the value + * `{field: {$gte: value}}` + * @name $gte + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"age" : {$gte : 50}} ); + */ + + $gte: function (qu, value) { + return qu.operands[0] <= value; + }, + /** + * `$lt` Sees if a field is less than the value + * `{field: {$lt: value}}` + * @name $lt + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"age" : {$lt : 24}} ); + */ + + $lt: function (qu, value) { + return qu.operands[0] > value; + }, + /** + * `$lte` Sees if a field is less than or equal to the value + * `{field: {$lte: value}}` + * @name $lte + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"age" : {$lte : 50}} ); + */ + + $lte: function (qu, value) { + return qu.operands[0] >= value; + }, + /** + * `$in` Sees if a field has one of the values in the query + * `{field: {$in: [test1, test2, test3,...]}}` + * @name $in + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"age" : {$in : [24, 28, 60]}} ); + */ + + $in: function (qu, value) { + var operands; + + operands = sys.flatten(qu.operands); + return sys.indexOf(operands, value) > -1; + }, + /** + * `$nin` Sees if a field has none of the values in the query + * `{field: {$nin: [test1, test2, test3,...]}}` + * @name $nin + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"age" : {$nin : [24, 28, 60]}} ); + */ + + $nin: function (qu, value) { + var operands; + + operands = sys.flatten(qu.operands); + return sys.indexOf(operands, value) === -1; + }, + /** + * `$exists` Sees if a field exists. + * `{field: {$exists: true|false}}` + * @name $exists + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"name.middle" : {$exists : true}} ); + */ + + $exists: function (qu, value) { + return (sys.isNull(value) || sys.isUndefined(value)) !== qu.operands[0]; + }, + /** + * Checks equality to a modulus operation on a field + * `{field: {$mod: [divisor, remainder]}}` + * @name $mod + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"age" : {$mod : [2, 0]}} ); + */ + + $mod: function (qu, value) { + var operands = sys.flatten(qu.operands); + if (operands.length !== 2) { + throw new Error("$mod requires two operands"); + } + var mod = operands[0]; + var rem = operands[1]; + return value % mod === rem; + }, + /** + * Compares the size of the field/array to the query. This can be used on arrays, strings and objects (where it will count keys) + * `{'field|array`: {$size: value}}` + * @name $size + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {attr : {$size : 3}} ); + */ + + $size: function (qu, value) { + return sys.size(value) === qu.operands[0]; + }, + /** + * Performs a regular expression test againts the field + * `{field: {$regex: re, $options: reOptions}}` + * @name $regex + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {"name.first" : {$regex : "m*", $options : "i"}} ); + */ + + $regex: function (qu, value) { + var r = new RegExp(qu.operands[0], qu.options); + return r.test(value); + }, + /** + * This is like $all except that it works with an array of objects or value. It checks to see the array matches all + * of the conditions of the query + * `{array: {$elemMatch: {path: value, path: {$operation: value2}}}` + * @name $elemMatch + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {attr : {$elemMatch : [ + * {color : "red", "hand" : "left"} + * ]}} ); + */ + $elemMatch: function (qu, value) { + var expression, test, _i, _len; + + if (sys.isArray(value)) { + var _ref = qu.operands; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + expression = _ref[_i]; + if (expression.path) { + expression.splitPath = splitPath(expression.path); + } + } + test = execQuery(value, qu.operands, null, true).arrayResults; + } + return test.length > 0; + }, + /** + * Returns true if all of the conditions of the query are met + * `{$and: [query1, query2, query3]}` + * @name $and + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {$and : [ + * {"name.first" : "Mildred"}, + * {"name.last" : "Graves"} + * ]} ); + */ + + $and: function (qu, value, record) { + var isAnd = false; + + sys.each(qu.operands, function (expr) { + if (expr.path) { + expr.splitPath = expr.splitPath || splitPath(expr.path); + } + var test = reachin(expr.splitPath, record, expr.operation); + isAnd = operations[expr.operation](expr, test, record); + if (!isAnd) { + return false; + } + }); + + return isAnd; + }, + /** + * Returns true if any of the conditions of the query are met + * `{$or: [query1, query2, query3]}` + * @name $or + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {$or : [ + * "age" : {$in : [24, 28, 60]}}, + * {categories : "cat1"} + * ]} ); + */ + $or: function (qu, value, record) { + var isOr = false; + sys.each(qu.operands, function (expr) { + if (expr.path) { + expr.splitPath = expr.splitPath || splitPath(expr.path); + } + var test = reachin(expr.splitPath, record, expr.operation); + isOr = operations[expr.operation](expr, test, record); + if (isOr) { + return false; + } + }); + + return isOr; + }, + /** + * Returns true if none of the conditions of the query are met + * `{$nor: [query1, query2, query3]}` + * @name $nor + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {$nor : [ + * {"age" : {$in : [24, 28, 60]}}, + * {categories : "cat1"} + * ]} ); + */ + $nor: function (qu, value, record) { + var isOr = false; + sys.each(qu.operands, function (expr) { + if (expr.path) { + expr.splitPath = expr.splitPath || splitPath(expr.path); + } + var test = reachin(expr.splitPath, record, expr.operation); + isOr = operations[expr.operation](expr, test, record); + if (isOr) { + return false; + } + }); + + return !isOr; + }, + /** + * Logical NOT on the conditions of the query + * `{$not: [query1, query2, query3]}` + * @name $not + * @memberOf module:documents/probe.queryOperators + * @example + * var probe = require("documents/probe"); + * probe.find( data, {$not : {"age" : {$lt : 24}}} ); + */ + $not: function (qu, value, record) { + var result = false; + sys.each(qu.operands, function (expr) { + if (expr.path) { + expr.splitPath = expr.splitPath || splitPath(expr.path); + } + var test = reachin(expr.splitPath, record, expr.operation); + result = operations[expr.operation](expr, test, record); + if (result) { + return false; + } + }); + + return !result; + }, +}; + +/** + Executes a query by traversing a document and evaluating each record + @private + @param {array|object} obj The object to query + @param {object} qu The query to execute + @param {?boolean} shortCircuit When true, the condition that matches the query stops evaluation for that record, otherwise all conditions have to be met + @param {?boolean} stopOnFirst When true all evaluation stops after the first record is found to match the conditons + **/ +function execQuery(obj, qu, shortCircuit, stopOnFirst) { + var arrayResults = []; + var keyResults = []; + sys.each(obj, function (record, key) { + var expr, result, test, _i, _len; + + for (_i = 0, _len = qu.length; _i < _len; _i++) { + expr = qu[_i]; + if (expr.splitPath) { + test = reachin(expr.splitPath, record, expr.operation); + } + result = operations[expr.operation](expr, test, record); + if (result) { + arrayResults.push(record); + keyResults.push(key); + } + if (!result && shortCircuit) { + break; + } + } + if (arrayResults.length > 0 && stopOnFirst) { + return false; + } + }); + return { + arrayResults: arrayResults, + keyResults: keyResults, + }; +} + +/** + Updates all records in obj that match the query. See {@link module:documents/probe.updateOperators} for the operators that are supported. + @param {object|array} obj The object to update + @param {object} qu The query which will be used to identify the records to updated + @param {object} setDocument The update operator. See {@link module:documents/probe.updateOperators} + */ +exports.update = function (obj, qu, setDocument) { + var records = exports.find(obj, qu); + return sys.each(records, function (record) { + return sys.each(setDocument, function (fields, operator) { + return sys.each(fields, function (newValue, path) { + return pushin(splitPath(path), record, operator, newValue); + }); + }); + }); +}; +/** + Find all records that match a query + @param {array|object} obj The object to query + @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. + @returns {array} The results + **/ +exports.find = function (obj, qu) { + var expression, _i, _len; + + var query = parseQueryExpression(qu); + for (_i = 0, _len = query.length; _i < _len; _i++) { + expression = query[_i]; + if (expression.path) { + expression.splitPath = splitPath(expression.path); + } + } + return execQuery(obj, query).arrayResults; +}; +/** + Find all records that match a query and returns the keys for those items. This is similar to {@link module:documents/probe.find} but instead of returning + records, returns the keys. If `obj` is an object it will return the hash key. If 'obj' is an array, it will return the index + @param {array|object} obj The object to query + @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. + @returns {array} + */ +exports.findKeys = function (obj, qu) { + var expression, _i, _len; + + var query = parseQueryExpression(qu); + for (_i = 0, _len = query.length; _i < _len; _i++) { + expression = query[_i]; + if (expression.path) { + expression.splitPath = splitPath(expression.path); + } + } + return execQuery(obj, query).keyResults; +}; + +/** + Returns the first record that matches the query. Aliased as `seek`. + @param {array|object} obj The object to query + @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. + @returns {object} + */ +exports.findOne = function (obj, qu) { + var expression, _i, _len; + + var query = parseQueryExpression(qu); + for (_i = 0, _len = query.length; _i < _len; _i++) { + expression = query[_i]; + if (expression.path) { + expression.splitPath = splitPath(expression.path); + } + } + var results = execQuery(obj, query, false, true).arrayResults; + if (results.length > 0) { + return results[0]; + } else { + return null; + } +}; +exports.seek = exports.findOne; +/** + Returns the first record that matches the query and returns its key or index depending on whether `obj` is an object or array respectively. + Aliased as `seekKey`. + @param {array|object} obj The object to query + @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. + @returns {object} + */ +exports.findOneKey = function (obj, qu) { + var expression, _i, _len; + + var query = parseQueryExpression(qu); + for (_i = 0, _len = query.length; _i < _len; _i++) { + expression = query[_i]; + if (expression.path) { + expression.splitPath = splitPath(expression.path); + } + } + var results = execQuery(obj, query, false, true).keyResults; + if (results.length > 0) { + return results[0]; + } else { + return null; + } +}; +exports.seekKey = exports.findOneKey; + +/** + Remove all items in the object/array that match the query + @param {array|object} obj The object to query + @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. + @return {object|array} The array or object as appropriate without the records. + **/ +exports.remove = function (obj, qu) { + var expression, _i, _len; + + var query = parseQueryExpression(qu); + for (_i = 0, _len = query.length; _i < _len; _i++) { + expression = query[_i]; + if (expression.path) { + expression.splitPath = splitPath(expression.path); + } + } + var results = execQuery(obj, query, false, false).keyResults; + if (sys.isArray(obj)) { + var newArr = []; + sys.each(obj, function (item, index) { + if (sys.indexOf(results, index) === -1) { + return newArr.push(item); + } + }); + return newArr; + } else { + sys.each(results, function (key) { + return delete obj[key]; + }); + return obj; + } +}; +/** + Returns true if all items match the query + + @param {array|object} obj The object to query + @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. + @returns {boolean} + **/ +exports.all = function (obj, qu) { + return exports.find(obj, qu).length === sys.size(obj); +}; + +/** + Returns true if any of the items match the query + + @param {array|object} obj The object to query + @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. + @returns {boolean} + **/ +exports.any = function (obj, qu) { + var expression, _i, _len; + + var query = parseQueryExpression(qu); + for (_i = 0, _len = query.length; _i < _len; _i++) { + expression = query[_i]; + if (expression.path) { + expression.splitPath = splitPath(expression.path); + } + } + var results = execQuery(obj, query, true, true).keyResults; + return results.length > 0; +}; + +/** + Returns the set of unique records that match a query + @param {array|object} obj The object to query + @param {object} qu The query to execute. See {@link module:documents/probe.queryOperators} for the operators you can use. + @return {array} + **/ +exports.unique = function (obj, qu) { + var test = exports.find(obj, qu); + return sys.unique(test, function (item) { + return JSON.stringify(item); + }); +}; + +/** + This will write the value into a record at the path, creating intervening objects if they don't exist. This does not work as filtered + update and is meant to be used on a single record. It is a nice way of setting a property at an arbitrary depth at will. + + @param {array} path The split path of the element to work with + @param {object} record The record to reach into + @param {string} setter The set operation. See {@link module:documents/probe.updateOperators} for the operators you can use. + @param {object} newValue The value to write to the, or if the operator is $pull, the query of items to look for + */ +exports.set = function (record, path, setter, newValue) { + return pushin(splitPath(path), record, setter, newValue); +}; + +/** + Reaches into an object and allows you to get at a value deeply nested in an object. This is not a query, but a + straight reach in, useful for event bindings + + @param {array} path The split path of the element to work with + @param {object} record The record to reach into + @return {*} Whatever was found in the record + **/ +exports.get = function (record, path) { + return reachin(splitPath(path), record); +}; + +/** + Returns true if any of the items match the query. Aliases as `any` + @function + @param {array|object} obj The object to query + @param {object} qu The query to execute + @returns {boolean} + */ +exports.some = exports.any; + +/** + Returns true if all items match the query. Aliases as `all` + @function + @param {array|object} obj The object to query + @param {object} qu The query to execute + @returns {boolean} + */ +exports.every = exports.all; + +var bindables = { + any: exports.any, + all: exports.all, + remove: exports.remove, + seekKey: exports.seekKey, + seek: exports.seek, + findOneKey: exports.findOneKey, + findOne: exports.findOne, + findKeys: exports.findKeys, + find: exports.find, + update: exports.update, + some: exports.some, + every: exports.every, + get: exports.get, + set: exports.set, +}; + +/** + Binds the query and update methods to a new object. When called these + methods can skip the first parameter so that find(object, query) can just be called as find(query) + @param {object|array} obj The object or array to bind to + @return {object} An object with method bindings in place + **/ +exports.proxy = function (obj) { + var retVal; + + retVal = {}; + sys.each(bindables, function (val, key) { + retVal[key] = sys.bind(val, obj, obj); + }); + return retVal; +}; + +/** + Binds the query and update methods to a specific object and adds the methods to that object. When called these + methods can skip the first parameter so that find(object, query) can just be called as object.find(query) + @param {object|array} obj The object or array to bind to + @param {object|array=} collection If the collection is not the same as this but is a property, or even + a whole other object, you specify that here. Otherwise the obj is assumed to be the same as the collecion + **/ +exports.mixin = function (obj, collection) { + collection = collection || obj; + return sys.each(bindables, function (val, key) { + obj[key] = sys.bind(val, obj, collection); + }); +}; + +/** + * These are the supported query operators + * + * @memberOf module:documents/probe + * @name queryOperators + * @class This is not actually a class, but an artifact of the documentation system + */ + +/** + * These are the supported update operators + * + * @memberOf module:documents/probe + * @name updateOperators + * @class This is not actually a class, but an artifact of the documentation system + */ diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/schema.js b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/schema.js index cbedaca..e1b08fe 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/documents/schema.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/documents/schema.js @@ -1,292 +1,301 @@ -"use strict"; -/** - * @fileOverview Enables a schema and validation feature set to your document or other object. - * @module documents/schema - * @requires base - * @requires jjv - * @require lodash - */ -var sys = require( "lodash" ); -var Validator = require( "jjv" ); -var Base = require( "../base" ); -/** - * The validator mixin provides access to the features of the JSON validation system - * @exports documents/schema - * @mixin - */ -var Schema = Base.compose( [Base], /** @lends documents/schema# */{ - constructor : function () { - /** - * The schema that defines the validation rules. This should probably be defined at the prototype for each - * object or model classification. It can be an anonymous schema defined right here, or this can be - * registered schema names to use, or just a single name - * - * @type {object} - * @memberOf documents/schema# - * @name schema - */ - - /** - * If you want to register multiple schemas, use this property instead - * - * @type {object} - * @memberOf documents/schema# - * @name schemas - */ - - /** - * The validation environment - * @private - * @type {jjv} - */ - var env = new Validator(); - - /** - * The default name of the scheman when you use anonymous schemas. You can define this at the prototype for classified - * schemas. The can also - * - * @type {string|function():{string}} - * @memberOf documents/schema# - * @name _defaultSchemaName - */ - this._defaultSchemaName = sys.result( this, "_defaultSchemaName" ) || sys.uniqueId( "schema" ); - - /** - * The options to pass to the validator when it runs - * @type {object|function():{object}} - * @name validationOptions - * @memberOf documents/schema# - */ - this.validationOptions = sys.defaults( {}, sys.result( this, 'validationOptions' ), {checkRequired : true} ); - - /** - * Validate an object against the schema - * @returns {object?} - * @method - * @name validate - * @memberOf documents/schema# - * @param {object=} record The record to validate - * @param {string|object=} schemaName The name of a previously registered schema - * @param {object=} options Options to pass to the validator - * @example - * // This supports these signatures: - * - * instance.validate(record, schemaName, options); - * - * - * instance.validate(); // this, this._defaultSchemaName, this.validationOptions - * instance.validate(record); // record, this._defaultSchemaName, this.validationOptions - * instance.validate(schemaName); //this, schemaName, this.validationOptions - * instance.validate(record, schemaName); //record, schemaName, this.validationOptions - * instance.validate(schemaName, options); //this, schemaName, this.validationOptions - */ - this.validate = function ( record, schemaName, options ) { - if ( arguments.length === 0 ) { - record = this; - schemaName = this._defaultSchemaName; - options = this.validationOptions; - } else { - if ( sys.isString( record ) ) { - schemaName = record; - record = this; - } - if ( sys.isEmpty( options ) ) { - options = this.validationOptions; - } - } - - return env.validate( schemaName, record, options ); - }; - - /** - * Initialize the schema collection by registering the with the handler. You can call this at any time and as often as you like. It will be called once - * by the constructor on any instance schemas - * @method - * @name registerSchemas - * @memberOf documents/schema# - * @param {hash} schemas A hash of schemas where the key is the name of the schema - */ - this.registerSchemas = function ( schemas ) { - var schema = sys.result( this, "schema" ); - var schemas = schemas || sys.result( this, "schemas" ); - if ( !sys.isEmpty( schema ) ) { - env.addSchema( this._defaultSchemaName, schema ); - } - if ( !sys.isEmpty( schemas ) ) { - sys.each( schemas, function ( val, key ) { - env.addSchema( val, key ); - } ); - } - }; - - /** - * Extracts only the elements of the object that are defined in the schema - * @memberOf documents/schema# - * @name extract - * @param {object=} record The record to extract from - * @param {string=} schema The name of the schema to attach - * @method - */ - this.extract = function ( record, schema ) { - if ( arguments.length === 0 ) { - record = this; - schema = this._defaultSchemaName; - } - if ( sys.isString( record ) ) { - schema = record; - record = this; - } - }; - - /** - * Create a type to be used in your schemas to define new validators - * @memberOf documents/schema# - * @name addType - * @method - * @param {string} name The name of the type - * @param {function(object)} operation What to do with the type. - * @param {object} operation.value The value to validation - * @returns {boolean} - */ - this.addType = env.addType; - - /** - * It is also possible to add support for additional string formats through the addFormat function. - * @memberOf documents/schema# - * @name addFormat - * @method - * @param {string} name The name of the formatter - * @param {function(object)} formatter How to format it - * @param {object} formatter.value The value to format - * @returns {boolean} - */ - this.addFormat = env.addFormat; - - /** - * It is possible to add support for custom checks (i.e., minItems, maxItems, minLength, maxLength, etc.) through the addCheck function - * @memberOf documents/schema# - * @name addCheck - * @method - * @param {string} name The name of the check - * @param {function(...object)} formatter Perform the check - * @param {object} formatter.value The value to check followed by any parameters from the schema - * @returns {boolean} - */ - this.addCheck = env.addCheck; - - /** - * Custom coercion rules - * - * @memberOf documents/schema# - * @name addTypeCoercion - * @method - * @param {string} name The name of the coercion - * @param {function(object)} coercer Perform the coercion - * @param {object} coercer.value The value to coerce - * @returns {boolean} - */ - this.addTypeCoercion = env.addTypeCoercion; - - /** - * Get a registered schema by name - * @param {string=} schemaName - * @returns {object?} - * @memberOf documents/schema# - * @name getSchema - * @method - */ - this.getSchema = function ( schemaName ) { - if ( sys.isEmpty( schemaName ) || !sys.isString() ) { - schemaName = this._defaultSchemaName; - } - return env.schema[schemaName]; - } - }, - /** - * This method will create a new object that contains only the fields and no methods or other artifacts. This is useful - * for creating objects to pass over the wire or save in a table. This is not deeply copied, so changes made to the - * extracted object will be represented in this class for reference objects. - * - * @param {string=} schema The schema name to use - * @param {object=} src The object to extract fields from - * @return {object} Data-only version of the class instance. - */ - extract : function ( schemaName, src ) { - if ( sys.isObject( schemaName ) ) { - src = schema; - schemaName = this._defaultSchemaName; - } - - if ( sys.isEmpty( src ) ) { - src = this; - } - - if ( sys.isFunction( src.toJSON ) ) { - src = src.toJSON(); - } - var schema = this.getSchema( schemaName ) || {}; - var newobj = {}; - sys.each( schema.properties, function ( prop, propname ) { - if ( prop.properties && !sys.isUndefined( src[ propname ] ) ) { - newobj[ propname ] = this.extract( prop, src[propname] ); - } else if ( !sys.isUndefined( src[ propname ] ) ) { - newobj[ propname ] = src[ propname ]; - } - }, this ); - - return newobj; - }, - /** - * Builds a default document based on the schema. What this does is create a document from schema and for each property - * that has a default value or is required, the resultant object will contain that property. It is useful for extending - * values from some source that may be incomplete, like options or some such. - * @param {json-schema} schema A schema to use to create the default document - * @returns {object?} - * @name defaultDoc - * @memberOf documents/schema# - * @method - */ - defaultDoc : function ( schemaName ) { - if ( sys.isEmpty( schemaName ) ) { - schemaName = this._defaultSchemaName; - } - var newdoc = {}; - var schema; - - if ( sys.isObject( schemaName ) ) { - schema = schemaName; - } else { - schema = this.getSchema( schemaName ) || {}; - } - sys.each( schema.properties, function ( val, key ) { - - var def = val[ "default" ]; // keyword and all that - if ( val.type === "object" && !sys.isEmpty( val.properties ) ) { - newdoc[ key ] = this.defaultDoc( val ); - } else { - if ( sys.isFunction( def ) || sys.isBoolean( def ) || sys.isNumber( def ) || !sys.isEmpty( def ) ) { - - if ( sys.isFunction( def ) ) { - newdoc[ key ] = def( schema ); - } else { - newdoc[ key ] = def; - } - } else if ( val.required ) { - if ( val.type === 'string' ) { - newdoc[ key ] = null; - } else if ( val.type === 'object' ) { - newdoc[ key ] = {}; - } else if ( val.type === 'array' ) { - newdoc[ key ] = []; - } else { - newdoc[ key ] = null; - } - } - } - }, this ); - - return newdoc; - } -} ); - -module.exports = Schema; +"use strict"; +/** + * @fileOverview Enables a schema and validation feature set to your document or other object. + * @module documents/schema + * @requires base + * @requires jjv + * @require lodash + */ +var sys = require("lodash"); +var Validator = require("jjv"); +var Base = require("../base"); +/** + * The validator mixin provides access to the features of the JSON validation system + * @exports documents/schema + * @mixin + */ +var Schema = Base.compose( + [Base], + /** @lends documents/schema# */ { + constructor: function () { + /** + * The schema that defines the validation rules. This should probably be defined at the prototype for each + * object or model classification. It can be an anonymous schema defined right here, or this can be + * registered schema names to use, or just a single name + * + * @type {object} + * @memberOf documents/schema# + * @name schema + */ + + /** + * If you want to register multiple schemas, use this property instead + * + * @type {object} + * @memberOf documents/schema# + * @name schemas + */ + + /** + * The validation environment + * @private + * @type {jjv} + */ + var env = new Validator(); + + /** + * The default name of the scheman when you use anonymous schemas. You can define this at the prototype for classified + * schemas. The can also + * + * @type {string|function():{string}} + * @memberOf documents/schema# + * @name _defaultSchemaName + */ + this._defaultSchemaName = sys.result(this, "_defaultSchemaName") || sys.uniqueId("schema"); + + /** + * The options to pass to the validator when it runs + * @type {object|function():{object}} + * @name validationOptions + * @memberOf documents/schema# + */ + this.validationOptions = sys.defaults({}, sys.result(this, "validationOptions"), { checkRequired: true }); + + /** + * Validate an object against the schema + * @returns {object?} + * @method + * @name validate + * @memberOf documents/schema# + * @param {object=} record The record to validate + * @param {string|object=} schemaName The name of a previously registered schema + * @param {object=} options Options to pass to the validator + * @example + * // This supports these signatures: + * + * instance.validate(record, schemaName, options); + * + * + * instance.validate(); // this, this._defaultSchemaName, this.validationOptions + * instance.validate(record); // record, this._defaultSchemaName, this.validationOptions + * instance.validate(schemaName); //this, schemaName, this.validationOptions + * instance.validate(record, schemaName); //record, schemaName, this.validationOptions + * instance.validate(schemaName, options); //this, schemaName, this.validationOptions + */ + this.validate = function (record, schemaName, options) { + if (arguments.length === 0) { + record = this; + schemaName = this._defaultSchemaName; + options = this.validationOptions; + } else { + if (sys.isString(record)) { + schemaName = record; + record = this; + } + if (sys.isEmpty(options)) { + options = this.validationOptions; + } + } + + return env.validate(schemaName, record, options); + }; + + /** + * Initialize the schema collection by registering the with the handler. You can call this at any time and as often as you like. It will be called once + * by the constructor on any instance schemas + * @method + * @name registerSchemas + * @memberOf documents/schema# + * @param {hash} schemas A hash of schemas where the key is the name of the schema + */ + this.registerSchemas = function (schemas) { + var schema = sys.result(this, "schema"); + var schemas = schemas || sys.result(this, "schemas"); + if (!sys.isEmpty(schema)) { + env.addSchema(this._defaultSchemaName, schema); + } + if (!sys.isEmpty(schemas)) { + sys.each(schemas, function (val, key) { + env.addSchema(val, key); + }); + } + }; + + /** + * Extracts only the elements of the object that are defined in the schema + * @memberOf documents/schema# + * @name extract + * @param {object=} record The record to extract from + * @param {string=} schema The name of the schema to attach + * @method + */ + this.extract = function (record, schema) { + if (arguments.length === 0) { + record = this; + schema = this._defaultSchemaName; + } + if (sys.isString(record)) { + schema = record; + record = this; + } + }; + + /** + * Create a type to be used in your schemas to define new validators + * @memberOf documents/schema# + * @name addType + * @method + * @param {string} name The name of the type + * @param {function(object)} operation What to do with the type. + * @param {object} operation.value The value to validation + * @returns {boolean} + */ + this.addType = env.addType; + + /** + * It is also possible to add support for additional string formats through the addFormat function. + * @memberOf documents/schema# + * @name addFormat + * @method + * @param {string} name The name of the formatter + * @param {function(object)} formatter How to format it + * @param {object} formatter.value The value to format + * @returns {boolean} + */ + this.addFormat = env.addFormat; + + /** + * It is possible to add support for custom checks (i.e., minItems, maxItems, minLength, maxLength, etc.) through the addCheck function + * @memberOf documents/schema# + * @name addCheck + * @method + * @param {string} name The name of the check + * @param {function(...object)} formatter Perform the check + * @param {object} formatter.value The value to check followed by any parameters from the schema + * @returns {boolean} + */ + this.addCheck = env.addCheck; + + /** + * Custom coercion rules + * + * @memberOf documents/schema# + * @name addTypeCoercion + * @method + * @param {string} name The name of the coercion + * @param {function(object)} coercer Perform the coercion + * @param {object} coercer.value The value to coerce + * @returns {boolean} + */ + this.addTypeCoercion = env.addTypeCoercion; + + /** + * Get a registered schema by name + * @param {string=} schemaName + * @returns {object?} + * @memberOf documents/schema# + * @name getSchema + * @method + */ + this.getSchema = function (schemaName) { + if (sys.isEmpty(schemaName) || !sys.isString()) { + schemaName = this._defaultSchemaName; + } + return env.schema[schemaName]; + }; + }, + /** + * This method will create a new object that contains only the fields and no methods or other artifacts. This is useful + * for creating objects to pass over the wire or save in a table. This is not deeply copied, so changes made to the + * extracted object will be represented in this class for reference objects. + * + * @param {string=} schema The schema name to use + * @param {object=} src The object to extract fields from + * @return {object} Data-only version of the class instance. + */ + extract: function (schemaName, src) { + if (sys.isObject(schemaName)) { + src = schema; + schemaName = this._defaultSchemaName; + } + + if (sys.isEmpty(src)) { + src = this; + } + + if (sys.isFunction(src.toJSON)) { + src = src.toJSON(); + } + var schema = this.getSchema(schemaName) || {}; + var newobj = {}; + sys.each( + schema.properties, + function (prop, propname) { + if (prop.properties && !sys.isUndefined(src[propname])) { + newobj[propname] = this.extract(prop, src[propname]); + } else if (!sys.isUndefined(src[propname])) { + newobj[propname] = src[propname]; + } + }, + this + ); + + return newobj; + }, + /** + * Builds a default document based on the schema. What this does is create a document from schema and for each property + * that has a default value or is required, the resultant object will contain that property. It is useful for extending + * values from some source that may be incomplete, like options or some such. + * @param {json-schema} schema A schema to use to create the default document + * @returns {object?} + * @name defaultDoc + * @memberOf documents/schema# + * @method + */ + defaultDoc: function (schemaName) { + if (sys.isEmpty(schemaName)) { + schemaName = this._defaultSchemaName; + } + var newdoc = {}; + var schema; + + if (sys.isObject(schemaName)) { + schema = schemaName; + } else { + schema = this.getSchema(schemaName) || {}; + } + sys.each( + schema.properties, + function (val, key) { + var def = val["default"]; // keyword and all that + if (val.type === "object" && !sys.isEmpty(val.properties)) { + newdoc[key] = this.defaultDoc(val); + } else { + if (sys.isFunction(def) || sys.isBoolean(def) || sys.isNumber(def) || !sys.isEmpty(def)) { + if (sys.isFunction(def)) { + newdoc[key] = def(schema); + } else { + newdoc[key] = def; + } + } else if (val.required) { + if (val.type === "string") { + newdoc[key] = null; + } else if (val.type === "object") { + newdoc[key] = {}; + } else if (val.type === "array") { + newdoc[key] = []; + } else { + newdoc[key] = null; + } + } + } + }, + this + ); + + return newdoc; + }, + } +); + +module.exports = Schema; diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/mixins/bussable.js b/__DOCS__/JSDocTemplate/test-src/fixtures/mixins/bussable.js index 6a8e65c..4005cef 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/mixins/bussable.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/mixins/bussable.js @@ -1,99 +1,106 @@ -"use strict"; -/** - * @fileOverview Provides easy access to the system bus and provides some helper methods for doing so - * @module mixins/bussable - * @requires postal - * @requires lodash - * @requires base - */ -var bus = require( "postal" ); -var Base = require( "../base" ); -var sys = require( "lodash" ); - -/** - * @classDesc Provides easy access to the system bus and provides some helper methods for doing so - * @exports mixins/bussable - * @mixin - */ -var Bussable = Base.compose( [Base], /** @lends mixins/bussable# */{ - declaredClass : "mixins/Bussable", - constructor : function () { - /** - * The list of subscriptions maintained by the mixin - * @type {Array} - * @memberof mixins/bussable# - * @name _subscriptions - * @private - */ - this._subscriptions = {}; - - this.log.trace( "Bussable constructor" ); - }, - - /** - * Subscribe to an event - * @param {string} channel The channel to subscribe to - * @param {string} topic The topic to subscribe to - * @param {callback} [callback] What to do when you get the event - * @returns {object} The subscription definition - */ - subscribe : function ( channel, topic, callback ) { - this.log.trace( "Bussable subscribe" ); - var sub = bus.subscribe( {channel : channel, topic : topic, callback : callback} ); - this.subscriptions[channel + "." + topic] = sub; - return sub; - }, - - /** - * Subscribe to an event once - * @param {string} channel The channel to subscribe to - * @param {string} [topic] The topic to subscribe to - * @param {callback} [callback] What to do when you get the event - * @returns {object} The subscription definition - */ - once : function ( channel, topic, callback ) { - this.log.trace( "Bussable once" ); - var sub = this.subscribe( channel, topic, callback ); - this.subscriptions[channel + "." + topic] = sub; - sub.disposeAfter( 1 ); - return sub; - }, - - /** - * Publish an event on the system bus - * @param {string} [channel='2'] The channel to publish to - * @param {string} [topic=1] The topic to publish to - * @param {object} [options={}] What to pass to the event - * @param {boolean} [options.ha=2] Test sub prop - */ - publish : function ( channel, topic, options ) { - this.log.trace( "Bussable publish" ); - bus.publish( {channel : channel, topic : topic, data : options} ); - }, - - /** - * Get a subscription definition - * - * @param {string} channel - * @param {string} topic - * @returns {object=} The subscription definition - */ - getSubscription : function ( channel, topic ) { - this.log.trace( "Bussable getSubscription" ); - return this.subscriptions[channel + "." + topic]; - }, - - /** - * Gets rid of all subscriptions for this object. - * @private - */ - destroy : function () { - this.log.trace( "Bussable destroy" ); - - sys.each( this.subscriptions, function ( sub ) { - sub.unsubscribe(); - } ); - } -} ); - -module.exports = Bussable; +"use strict"; +/** + * @fileOverview Provides easy access to the system bus and provides some helper methods for doing so + * @module mixins/bussable + * @requires postal + * @requires lodash + * @requires base + */ +var bus = require("postal"); +var Base = require("../base"); +var sys = require("lodash"); + +/** + * @classDesc Provides easy access to the system bus and provides some helper methods for doing so + * @exports mixins/bussable + * @mixin + */ +var Bussable = Base.compose( + [Base], + /** @lends mixins/bussable# */ { + declaredClass: "mixins/Bussable", + constructor: function () { + /** + * The list of subscriptions maintained by the mixin + * @type {Array} + * @memberof mixins/bussable# + * @name _subscriptions + * @private + */ + this._subscriptions = {}; + + this.log.trace("Bussable constructor"); + }, + + /** + * Subscribe to an event + * @param {string} channel The channel to subscribe to + * @param {string} topic The topic to subscribe to + * @param {callback} [callback] What to do when you get the event + * @returns {object} The subscription definition + */ + subscribe: function (channel, topic, callback) { + this.log.trace("Bussable subscribe"); + var sub = bus.subscribe({ + channel: channel, + topic: topic, + callback: callback, + }); + this.subscriptions[channel + "." + topic] = sub; + return sub; + }, + + /** + * Subscribe to an event once + * @param {string} channel The channel to subscribe to + * @param {string} [topic] The topic to subscribe to + * @param {callback} [callback] What to do when you get the event + * @returns {object} The subscription definition + */ + once: function (channel, topic, callback) { + this.log.trace("Bussable once"); + var sub = this.subscribe(channel, topic, callback); + this.subscriptions[channel + "." + topic] = sub; + sub.disposeAfter(1); + return sub; + }, + + /** + * Publish an event on the system bus + * @param {string} [channel='2'] The channel to publish to + * @param {string} [topic=1] The topic to publish to + * @param {object} [options={}] What to pass to the event + * @param {boolean} [options.ha=2] Test sub prop + */ + publish: function (channel, topic, options) { + this.log.trace("Bussable publish"); + bus.publish({ channel: channel, topic: topic, data: options }); + }, + + /** + * Get a subscription definition + * + * @param {string} channel + * @param {string} topic + * @returns {object=} The subscription definition + */ + getSubscription: function (channel, topic) { + this.log.trace("Bussable getSubscription"); + return this.subscriptions[channel + "." + topic]; + }, + + /** + * Gets rid of all subscriptions for this object. + * @private + */ + destroy: function () { + this.log.trace("Bussable destroy"); + + sys.each(this.subscriptions, function (sub) { + sub.unsubscribe(); + }); + }, + } +); + +module.exports = Bussable; diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/mixins/signalable.js b/__DOCS__/JSDocTemplate/test-src/fixtures/mixins/signalable.js index f1bf3a0..4928518 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/mixins/signalable.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/mixins/signalable.js @@ -1,245 +1,251 @@ -"use strict"; -/** - * @fileOverview Add the ability to fire signals on your objects. Signals are events, but hard coded into the object - * and don't rely on strings like other events and `eventables` - * @module mixins/signalable - * @requires base - * @requires signals - * @requires base/logger - */ - -var Base = require( "../base" ); -var signals = require( 'signals' ); -var format = require( "../strings/format" ); -var sys = require( "lodash" ); - -/** - * @typedef - * @property {boolean=} memorize If Signal should keep record of previously dispatched parameters and automatically execute listener. Defaults to `false` - * @property {array=} params Default parameters passed to listener during `Signal.raise`/`Signal.fire`/`Signal.trigger` and SignalBinding.execute. (curried parameters). Defaults to `null` - * @property {object=} context When provided the signal will be raised in the context of this object. Defaults to `this` - the signal host - * @name SignalOptions - * @memberOf module:mixins/signalable - * @example - * - * signals:{ - * opened: null, - * twisted: { memorize:true }, - * applied: { memorize: false, params:[one, two] } - * } - * - * // Setting the context initially can be a hassle, so this also supports a function that returns a hash - * - * signals: function(){ - * return { - * opened: null, - * twisted: { memorize:true }, - * applied: { memorize: false, params:[one, two] }, - * reversed: {context: someOtherRuntimeObject} - * }; - * } - * - */ - -/** - * @classDesc A signal that can be raised on an object. When you deploy the `Signalable` mixin, it - * creates instances of these for you. - * - * @constructor - * @param {?object} host If hosted, you can identify the host here. - * @param {?string} name The name of the signal - * @type module:mixins/signalable.SignalOptions - */ -var Signal = Base.compose( [Base, signals.Signal], /** @lends module:mixins/signalable~Signal# */{ - declaredClass : "mixins/Signal", - - constructor : function ( host, name, options ) { - options = options || {}; - this.memorize = options.memorize === true; - this.host = host; - this.trigger = this.fire = this.raise = this.dispatch; - this.name = name || sys.uniqueId( "signal" ); - this.params = options.params; - this.defaultContext = options.context; - }, - - /** - * Cleans up - * @private - */ - destroy : function () { - this.removeAll(); - this.dispose(); - this.host = null; - }, - - /** - * Ties a listener to a signal. - * @param {function} listener The function to call when the signal is raised - * @param {?object} listenerContext A context to set for the listener. The event host may set a default for this value, but you may override that here. - * @param {?number} priority A priority for the listener. - * @returns {SignalBinding} - */ - on : function ( listener, listenerContext, priority ) { - if ( sys.isNumber( listenerContext ) ) { - priority = listenerContext; - listenerContext = null; - } - listenerContext = listenerContext || this.defaultContext || this.host; - var binding = this.add( listener, listenerContext, priority ); - if ( this.options.params ) { - binding.params = this.arams; - } - return binding; - }, - /** - * Ties a listener to for a signal for one execution. - * @param {function} listener The function to call when the signal is raised - * @param {?object} listenerContext A context to set for the listener. The event host may set a default for this value, but you may override that here. - * @param {?number} priority A priority for the listener. - * @returns {SignalBinding} - */ - once : function ( listener, listenerContext, priority ) { - if ( sys.isNumber( listenerContext ) ) { - priority = listenerContext; - listenerContext = null; - } - listenerContext = listenerContext || this.defaultContext || this.host; - var binding = this.addOnce( listener, listenerContext, priority ); - if ( this.options.params ) { - binding.params = this.params; - } - return binding; - }, - /** - * Unbinds a listener to a signal. - * @param {function} listener The function to unbind - * @param {?object} listenerContext The context that was bound - * @returns {function} - */ - off : function ( listener, listenerContext ) { - listenerContext = listenerContext || this.host; - return this.remove( listener, listenerContext ); - }, - /** - * Check if listener was attached to Signal. - * @param {function} listener The function to check - * @param {?object} listenerContext The context that was bound - * @returns {boolean} - */ - has : function ( listener, listenerContext ) { - listenerContext = listenerContext || this.defaultContext || this.host; - return this.remove( listener, listenerContext ); - }, - /** - * Strings! - */ - toString : function () { - return format( "{0}\nname:{1}\nlisteners:{2}", - this.declaredClass, - this.name, - this.getNumListeners() - ); - } - -} ); - -/** - * @classDesc Make an object capable of handling a signal. Or many signals. - * @exports mixins/signalable - * @mixin - * @extends base - */ -var Signalable = Base.compose( [Base], /** @lends mixins/signalable# */{ - declaredClass : "mixins/Signalable", - - constructor : function () { - this.autoLoadSignals = this.autoLoadSignals || true; - if ( this.autoLoadSignals === true ) { - this._loadSignals(); - } - }, - /** - * When you make a change to the signals hash after loading, then you can make it reload - */ - refreshSignals : function () { - this._loadSignals(); - }, - - /** - * Interprets the `signals` hash and instantiates it - * @private - */ - _loadSignals : function () { - var signals = this.signals || {}; - sys.each( signals, function ( value, key ) { - var opts = {}; - if ( !sys.isEmpty( value ) ) { - if ( sys.isBoolean( value.memorize ) ) { - opts.memorize = value.memorize; - } - if ( sys.isBoolean( value.params ) ) { - opts.params = value.params; - } - if ( !sys.isEmpty( value.context ) ) { - opts.context = value.context; - } - } - this._addSignal( key, opts ); - } ); - }, - /** - * Creates a single signal - * @param {string} name The name of the signal - * @param {module:mixins/signalable~SignalOptions} options The options the signal expects - * @private - */ - _addSignal : function ( name, options ) { - if ( sys.isEmpty( this[name] ) ) { - this[name] = new Signal( this, name, options ); - } - }, - - /** - * Add a signal to an object. If any members of the hash already exist in `this.signals`, they will be overwritten. - * @param {module:mixins/signalable.SignalOptions} signals - * @private - */ - _addSignals : function ( signals ) { - signals = signals || {}; - if ( this.options ) {signals = sys.extend( {}, sys.result( this, 'signals' ), signals );} - this.signals = signals; - }, - /** - * Clean up - * @private - */ - destroy : function () { - sys.each( sys.keys( this ), function ( key ) { - if ( this[key] instanceof Signal || this[key] instanceof signals.Signal ) { - this[key].close(); - } - }, this ); - } -} ); - -module.exports = Signalable; -alable.Signal = Signal; -Signalable.mixin = Base.mixin; - -/** - * When true, the class will load the `signals` hash and create the signal definitions during construction - * @memberOf mixins/signalable# - * @name autoLoadSignals - * @type boolean - */ - - -/** - * A hash of signals to create automatically. Each definition consists of a name for the signal as the key - * and then a hash of options (nullable) for each signal - * @type {hash|function():hash} - * @memberOf mixins/signalable# - * @name signals - * @type module:mixins/signalable.SignalOptions - */ +"use strict"; +/** + * @fileOverview Add the ability to fire signals on your objects. Signals are events, but hard coded into the object + * and don't rely on strings like other events and `eventables` + * @module mixins/signalable + * @requires base + * @requires signals + * @requires base/logger + */ + +var Base = require("../base"); +var signals = require("signals"); +var format = require("../strings/format"); +var sys = require("lodash"); + +/** + * @typedef + * @property {boolean=} memorize If Signal should keep record of previously dispatched parameters and automatically execute listener. Defaults to `false` + * @property {array=} params Default parameters passed to listener during `Signal.raise`/`Signal.fire`/`Signal.trigger` and SignalBinding.execute. (curried parameters). Defaults to `null` + * @property {object=} context When provided the signal will be raised in the context of this object. Defaults to `this` - the signal host + * @name SignalOptions + * @memberOf module:mixins/signalable + * @example + * + * signals:{ + * opened: null, + * twisted: { memorize:true }, + * applied: { memorize: false, params:[one, two] } + * } + * + * // Setting the context initially can be a hassle, so this also supports a function that returns a hash + * + * signals: function(){ + * return { + * opened: null, + * twisted: { memorize:true }, + * applied: { memorize: false, params:[one, two] }, + * reversed: {context: someOtherRuntimeObject} + * }; + * } + * + */ + +/** + * @classDesc A signal that can be raised on an object. When you deploy the `Signalable` mixin, it + * creates instances of these for you. + * + * @constructor + * @param {?object} host If hosted, you can identify the host here. + * @param {?string} name The name of the signal + * @type module:mixins/signalable.SignalOptions + */ +var Signal = Base.compose( + [Base, signals.Signal], + /** @lends module:mixins/signalable~Signal# */ { + declaredClass: "mixins/Signal", + + constructor: function (host, name, options) { + options = options || {}; + this.memorize = options.memorize === true; + this.host = host; + this.trigger = this.fire = this.raise = this.dispatch; + this.name = name || sys.uniqueId("signal"); + this.params = options.params; + this.defaultContext = options.context; + }, + + /** + * Cleans up + * @private + */ + destroy: function () { + this.removeAll(); + this.dispose(); + this.host = null; + }, + + /** + * Ties a listener to a signal. + * @param {function} listener The function to call when the signal is raised + * @param {?object} listenerContext A context to set for the listener. The event host may set a default for this value, but you may override that here. + * @param {?number} priority A priority for the listener. + * @returns {SignalBinding} + */ + on: function (listener, listenerContext, priority) { + if (sys.isNumber(listenerContext)) { + priority = listenerContext; + listenerContext = null; + } + listenerContext = listenerContext || this.defaultContext || this.host; + var binding = this.add(listener, listenerContext, priority); + if (this.options.params) { + binding.params = this.arams; + } + return binding; + }, + /** + * Ties a listener to for a signal for one execution. + * @param {function} listener The function to call when the signal is raised + * @param {?object} listenerContext A context to set for the listener. The event host may set a default for this value, but you may override that here. + * @param {?number} priority A priority for the listener. + * @returns {SignalBinding} + */ + once: function (listener, listenerContext, priority) { + if (sys.isNumber(listenerContext)) { + priority = listenerContext; + listenerContext = null; + } + listenerContext = listenerContext || this.defaultContext || this.host; + var binding = this.addOnce(listener, listenerContext, priority); + if (this.options.params) { + binding.params = this.params; + } + return binding; + }, + /** + * Unbinds a listener to a signal. + * @param {function} listener The function to unbind + * @param {?object} listenerContext The context that was bound + * @returns {function} + */ + off: function (listener, listenerContext) { + listenerContext = listenerContext || this.host; + return this.remove(listener, listenerContext); + }, + /** + * Check if listener was attached to Signal. + * @param {function} listener The function to check + * @param {?object} listenerContext The context that was bound + * @returns {boolean} + */ + has: function (listener, listenerContext) { + listenerContext = listenerContext || this.defaultContext || this.host; + return this.remove(listener, listenerContext); + }, + /** + * Strings! + */ + toString: function () { + return format("{0}\nname:{1}\nlisteners:{2}", this.declaredClass, this.name, this.getNumListeners()); + }, + } +); + +/** + * @classDesc Make an object capable of handling a signal. Or many signals. + * @exports mixins/signalable + * @mixin + * @extends base + */ +var Signalable = Base.compose( + [Base], + /** @lends mixins/signalable# */ { + declaredClass: "mixins/Signalable", + + constructor: function () { + this.autoLoadSignals = this.autoLoadSignals || true; + if (this.autoLoadSignals === true) { + this._loadSignals(); + } + }, + /** + * When you make a change to the signals hash after loading, then you can make it reload + */ + refreshSignals: function () { + this._loadSignals(); + }, + + /** + * Interprets the `signals` hash and instantiates it + * @private + */ + _loadSignals: function () { + var signals = this.signals || {}; + sys.each(signals, function (value, key) { + var opts = {}; + if (!sys.isEmpty(value)) { + if (sys.isBoolean(value.memorize)) { + opts.memorize = value.memorize; + } + if (sys.isBoolean(value.params)) { + opts.params = value.params; + } + if (!sys.isEmpty(value.context)) { + opts.context = value.context; + } + } + this._addSignal(key, opts); + }); + }, + /** + * Creates a single signal + * @param {string} name The name of the signal + * @param {module:mixins/signalable~SignalOptions} options The options the signal expects + * @private + */ + _addSignal: function (name, options) { + if (sys.isEmpty(this[name])) { + this[name] = new Signal(this, name, options); + } + }, + + /** + * Add a signal to an object. If any members of the hash already exist in `this.signals`, they will be overwritten. + * @param {module:mixins/signalable.SignalOptions} signals + * @private + */ + _addSignals: function (signals) { + signals = signals || {}; + if (this.options) { + signals = sys.extend({}, sys.result(this, "signals"), signals); + } + this.signals = signals; + }, + /** + * Clean up + * @private + */ + destroy: function () { + sys.each( + sys.keys(this), + function (key) { + if (this[key] instanceof Signal || this[key] instanceof signals.Signal) { + this[key].close(); + } + }, + this + ); + }, + } +); + +module.exports = Signalable; +alable.Signal = Signal; +Signalable.mixin = Base.mixin; + +/** + * When true, the class will load the `signals` hash and create the signal definitions during construction + * @memberOf mixins/signalable# + * @name autoLoadSignals + * @type boolean + */ + +/** + * A hash of signals to create automatically. Each definition consists of a name for the signal as the key + * and then a hash of options (nullable) for each signal + * @type {hash|function():hash} + * @memberOf mixins/signalable# + * @name signals + * @type module:mixins/signalable.SignalOptions + */ diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/strings/format.js b/__DOCS__/JSDocTemplate/test-src/fixtures/strings/format.js index 12d9ce1..8047dc8 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/strings/format.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/strings/format.js @@ -1,32 +1,29 @@ -"use strict"; -/** - * @fileOverview String helper methods - * - * @module strings/format - */ - -/** - * Format a string quickly and easily using .net style format strings - * @param {string} format A string format like "Hello {0}, now take off your {1}!" - * @param {...?} args One argument per `{}` in the string, positionally replaced - * @returns {string} - * - * @example - * var strings = require("papyrus/strings"); - * var s = strings.format("Hello {0}", "Madame Vastra"); - * // s = "Hello Madame Vastra" - * - * @example {@lang xml} - * - * <%= strings.format("Hello {0}", "Madame Vastra") %> - * - */ -module.exports = function ( format ) { - var args = Array.prototype.slice.call( arguments, 1 ); - return format.replace( /{(\d+)}/g, function ( match, number ) { - return typeof args[number] != 'undefined' - ? args[number] - : match - ; - } ); -}; +"use strict"; +/** + * @fileOverview String helper methods + * + * @module strings/format + */ + +/** + * Format a string quickly and easily using .net style format strings + * @param {string} format A string format like "Hello {0}, now take off your {1}!" + * @param {...?} args One argument per `{}` in the string, positionally replaced + * @returns {string} + * + * @example + * var strings = require("papyrus/strings"); + * var s = strings.format("Hello {0}", "Madame Vastra"); + * // s = "Hello Madame Vastra" + * + * @example {@lang xml} + * + * <%= strings.format("Hello {0}", "Madame Vastra") %> + * + */ +module.exports = function (format) { + var args = Array.prototype.slice.call(arguments, 1); + return format.replace(/{(\d+)}/g, function (match, number) { + return typeof args[number] != "undefined" ? args[number] : match; + }); +}; diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/brush-teeth.md b/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/brush-teeth.md index b39c382..603d093 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/brush-teeth.md +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/brush-teeth.md @@ -1,26 +1,26 @@ -# Lorem ipsum dolor sit amet - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra, tellus et fermentum tincidunt, massa ligula dignissim augue, ut aliquam tortor odio in odio. In faucibus metus metus. Curabitur est mi, fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan ac porta tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, mauris vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis commodo. - -| Fusce lacinia | mauris ac aliquam | consequat | lacus urna feugiat erat | id viverra mi mi sit amet tortor | -|---------------|-------------------|-------------|-------------------------------|---------------------------------------| -| Etiam ac | 1 | 3 | 4.5 | 6.78910 | -| Pellentesque e| 2 | 2 | 3 | 4 | - -neque lacus, quis posuere orci. Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In erat urna, condimentum ac feugiat id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas dignissim nulla in turpis tempus sed rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, dolor metus rhoncus justo, sed semper ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar neque in porta. Nullam quis lacus orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a. - -Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. Aliquam ac convallis enim. - -Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat. - -Nunc faucibus lacus eget odio ultricies nec ullamcorper risus pharetra. Nunc nec consequat urna. Curabitur condimentum ante vitae erat tristique vitae gravida quam dapibus. Cras ac justo dui, at faucibus urna. Nunc tristique, velit id feugiat fermentum, dolor enim egestas erat, at vestibulum ante ipsum vel orci. Duis quis ante id justo vehicula eleifend sed et urna. Sed sapien tortor, rutrum id ultrices eu, tincidunt tincidunt mi. Etiam blandit, neque eget interdum dignissim, lacus ante facilisis dolor, non viverra dui lorem vitae nibh. Morbi volutpat augue eget nulla luctus eu aliquam sem facilisis. Pellentesque sollicitudin commodo dolor sit amet vestibulum. Nam dictum posuere quam, in tincidunt erat rutrum eu. - -Etiam nec turpis purus, at lacinia sem. In commodo lacinia euismod. Curabitur tincidunt congue leo, eget iaculis orci volutpat pharetra. Fusce dignissim lacus lacus. Integer consectetur lacus rutrum risus malesuada at consectetur erat rutrum. Sed magna ipsum, fringilla eget auctor non, fringilla nec massa. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum nec tortor id nisi luctus aliquam. Maecenas cursus tincidunt ornare. Nulla a vestibulum odio. Mauris malesuada commodo justo quis mattis. Suspendisse mauris ligula, placerat at egestas in, tincidunt quis nibh. Aliquam ullamcorper elit at augue cursus quis pellentesque purus viverra. - -Nulla ultricies justo ac nisi consectetur posuere. Donec ornare pharetra erat, nec facilisis dui cursus quis. Quisque porttitor porttitor orci, sed facilisis urna facilisis sed. Sed tincidunt adipiscing turpis et hendrerit. Cras posuere orci ut mauris ullamcorper vitae laoreet nisi luctus. In rutrum tristique augue. Nam eleifend dignissim dui. - -Donec viverra egestas tellus non viverra. Aenean est ante, egestas sed scelerisque quis, aliquet sed lacus. Praesent non mauris neque, et adipiscing ante. Vestibulum quis quam vitae ipsum aliquet blandit. Vivamus condimentum euismod orci, in tincidunt justo rutrum faucibus. Phasellus nec lorem arcu. Donec tortor dui, facilisis in rutrum sit amet, pulvinar vitae lacus. Nam sodales sem eu nunc scelerisque vitae ullamcorper dolor facilisis. Duis imperdiet nisi in magna tempor convallis. Fusce at metus augue. Quisque dictum tempus mauris, in mattis ligula dignissim ut. - -Proin sodales, mi at tincidunt ornare, mi dui sagittis velit, sed dictum risus orci eu erat. Sed nunc leo, congue sed rutrum eget, lobortis ac lectus. Etiam non arcu nulla. Vestibulum rutrum dolor pulvinar lorem posuere blandit. Sed quis sapien dui. Nunc sagittis erat commodo quam porta cursus in non erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin a molestie neque. Aliquam iaculis lacus sed neque hendrerit at dignissim ligula imperdiet. Suspendisse venenatis, lorem at luctus scelerisque, sem purus pellentesque sapien, vitae ornare ipsum quam nec dui. Mauris neque est, interdum nec pulvinar eget, dapibus eleifend tellus. Fusce non lorem tortor. Nullam eget nunc quis felis aliquam consectetur. Aliquam tristique, turpis in feugiat blandit, lectus erat condimentum tortor, non egestas nisl sapien eget nibh. - -Aliquam elit turpis, faucibus et porta et, egestas nec nibh. Sed nisl est, pharetra a eleifend a, pretium ac eros. Sed leo eros, pulvinar vel faucibus dictum, aliquet ut quam. Maecenas et felis non ligula fringilla pretium fringilla sit amet ante. Nam varius imperdiet interdum. Ut non metus mauris, vel volutpat lorem. Nullam sagittis est quis lacus feugiat fringilla. Quisque orci lorem, semper ac accumsan vitae, blandit quis velit. Proin luctus sodales ultrices. Fusce mauris erat, facilisis ut consectetur at, fringilla feugiat orci. Aliquam a nisi a neque interdum suscipit id eget purus. Pellentesque tincidunt justo ut urna posuere non molestie quam auctor. +# Lorem ipsum dolor sit amet + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec viverra, tellus et fermentum tincidunt, massa ligula dignissim augue, ut aliquam tortor odio in odio. In faucibus metus metus. Curabitur est mi, fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan ac porta tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, mauris vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis commodo. + +| Fusce lacinia | mauris ac aliquam | consequat | lacus urna feugiat erat | id viverra mi mi sit amet tortor | +| -------------- | ----------------- | --------- | ----------------------- | -------------------------------- | +| Etiam ac | 1 | 3 | 4.5 | 6.78910 | +| Pellentesque e | 2 | 2 | 3 | 4 | + +neque lacus, quis posuere orci. Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In erat urna, condimentum ac feugiat id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas dignissim nulla in turpis tempus sed rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, dolor metus rhoncus justo, sed semper ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar neque in porta. Nullam quis lacus orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a. + +Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. Aliquam ac convallis enim. + +Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat. + +Nunc faucibus lacus eget odio ultricies nec ullamcorper risus pharetra. Nunc nec consequat urna. Curabitur condimentum ante vitae erat tristique vitae gravida quam dapibus. Cras ac justo dui, at faucibus urna. Nunc tristique, velit id feugiat fermentum, dolor enim egestas erat, at vestibulum ante ipsum vel orci. Duis quis ante id justo vehicula eleifend sed et urna. Sed sapien tortor, rutrum id ultrices eu, tincidunt tincidunt mi. Etiam blandit, neque eget interdum dignissim, lacus ante facilisis dolor, non viverra dui lorem vitae nibh. Morbi volutpat augue eget nulla luctus eu aliquam sem facilisis. Pellentesque sollicitudin commodo dolor sit amet vestibulum. Nam dictum posuere quam, in tincidunt erat rutrum eu. + +Etiam nec turpis purus, at lacinia sem. In commodo lacinia euismod. Curabitur tincidunt congue leo, eget iaculis orci volutpat pharetra. Fusce dignissim lacus lacus. Integer consectetur lacus rutrum risus malesuada at consectetur erat rutrum. Sed magna ipsum, fringilla eget auctor non, fringilla nec massa. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum nec tortor id nisi luctus aliquam. Maecenas cursus tincidunt ornare. Nulla a vestibulum odio. Mauris malesuada commodo justo quis mattis. Suspendisse mauris ligula, placerat at egestas in, tincidunt quis nibh. Aliquam ullamcorper elit at augue cursus quis pellentesque purus viverra. + +Nulla ultricies justo ac nisi consectetur posuere. Donec ornare pharetra erat, nec facilisis dui cursus quis. Quisque porttitor porttitor orci, sed facilisis urna facilisis sed. Sed tincidunt adipiscing turpis et hendrerit. Cras posuere orci ut mauris ullamcorper vitae laoreet nisi luctus. In rutrum tristique augue. Nam eleifend dignissim dui. + +Donec viverra egestas tellus non viverra. Aenean est ante, egestas sed scelerisque quis, aliquet sed lacus. Praesent non mauris neque, et adipiscing ante. Vestibulum quis quam vitae ipsum aliquet blandit. Vivamus condimentum euismod orci, in tincidunt justo rutrum faucibus. Phasellus nec lorem arcu. Donec tortor dui, facilisis in rutrum sit amet, pulvinar vitae lacus. Nam sodales sem eu nunc scelerisque vitae ullamcorper dolor facilisis. Duis imperdiet nisi in magna tempor convallis. Fusce at metus augue. Quisque dictum tempus mauris, in mattis ligula dignissim ut. + +Proin sodales, mi at tincidunt ornare, mi dui sagittis velit, sed dictum risus orci eu erat. Sed nunc leo, congue sed rutrum eget, lobortis ac lectus. Etiam non arcu nulla. Vestibulum rutrum dolor pulvinar lorem posuere blandit. Sed quis sapien dui. Nunc sagittis erat commodo quam porta cursus in non erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin a molestie neque. Aliquam iaculis lacus sed neque hendrerit at dignissim ligula imperdiet. Suspendisse venenatis, lorem at luctus scelerisque, sem purus pellentesque sapien, vitae ornare ipsum quam nec dui. Mauris neque est, interdum nec pulvinar eget, dapibus eleifend tellus. Fusce non lorem tortor. Nullam eget nunc quis felis aliquam consectetur. Aliquam tristique, turpis in feugiat blandit, lectus erat condimentum tortor, non egestas nisl sapien eget nibh. + +Aliquam elit turpis, faucibus et porta et, egestas nec nibh. Sed nisl est, pharetra a eleifend a, pretium ac eros. Sed leo eros, pulvinar vel faucibus dictum, aliquet ut quam. Maecenas et felis non ligula fringilla pretium fringilla sit amet ante. Nam varius imperdiet interdum. Ut non metus mauris, vel volutpat lorem. Nullam sagittis est quis lacus feugiat fringilla. Quisque orci lorem, semper ac accumsan vitae, blandit quis velit. Proin luctus sodales ultrices. Fusce mauris erat, facilisis ut consectetur at, fringilla feugiat orci. Aliquam a nisi a neque interdum suscipit id eget purus. Pellentesque tincidunt justo ut urna posuere non molestie quam auctor. diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/drive-car.md b/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/drive-car.md index 8c3b40b..9ea857b 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/drive-car.md +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/drive-car.md @@ -1,10 +1,11 @@ -# Lorem ipsum dolor sit amet - -Curabitur est mi, fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan ac porta tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, mauris vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis commodo. - -## Fusce lacinia, mauris ac aliquam consequat -Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In erat urna, condimentum ac feugiat id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas dignissim nulla in turpis tempus sed rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, dolor metus rhoncus justo, sed semper ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar neque in porta. Nullam quis lacus orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a. - -Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. Aliquam ac convallis enim. - -Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat. +# Lorem ipsum dolor sit amet + +Curabitur est mi, fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan ac porta tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, mauris vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis commodo. + +## Fusce lacinia, mauris ac aliquam consequat + +Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In erat urna, condimentum ac feugiat id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas dignissim nulla in turpis tempus sed rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, dolor metus rhoncus justo, sed semper ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar neque in porta. Nullam quis lacus orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a. + +Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. Aliquam ac convallis enim. + +Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat. diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/fence-test.md b/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/fence-test.md index 38ceb2e..8502e6a 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/fence-test.md +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/fence-test.md @@ -1,66 +1,67 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non libero tristique, interdum quam in, fermentum massa. Aenean vestibulum velit eu massa faucibus accumsan. Aenean tempus quam ornare ligula gravida adipiscing. Suspendisse vestibulum diam quis quam lacinia convallis. Nunc rhoncus a elit ut dictum. Maecenas porta mi et risus convallis commodo. In hac habitasse platea dictumst. Morbi placerat sem nec eleifend hendrerit. Donec hendrerit pulvinar tristique. Pellentesque at nunc blandit, fringilla elit nec, dignissim arcu. Quisque sit amet enim urna. Nunc adipiscing lacinia justo. Pellentesque euismod nisi id elit auctor porttitor. Phasellus rutrum viverra felis, ac cursus ante vulputate ut. Donec laoreet felis ac risus vulputate sodales. - -Mauris sit amet risus non ligula lacinia iaculis. Sed ornare tellus velit, vel elementum quam porttitor tempus. Duis vestibulum augue eu diam malesuada auctor. Maecenas dignissim odio ut elit fermentum, id mollis leo mattis. Phasellus posuere augue sed interdum vestibulum. Etiam ac pharetra est. Integer tortor ligula, pharetra ac nisi nec, faucibus laoreet dolor. Nunc vehicula, enim et cursus tincidunt, nulla purus mollis urna, vel ultricies nisl mi a risus. Vestibulum sed urna sodales, pretium nisi sed, pretium sapien. Vivamus et massa tincidunt, semper nibh nec, eleifend urna. Integer auctor, eros at pharetra blandit, erat nibh mattis turpis, rhoncus elementum nisi mi vitae purus. - -Quisque elementum sapien id neque volutpat cursus non mattis velit. - - -```javascript -$mod : function ( qu, value ) { - var operands = sys.flatten( qu.operands ); - if ( operands.length !== 2 ) { - throw new Error( "$mod requires two operands" ); - } - var mod = operands[0]; - var rem = operands[1]; - return value % mod === rem; - }, -``` - -```bash -#!/bin/bash -echo Please, enter your firstname and lastname -read FN LN -echo "Hi! $LN, $FN !" -``` - -```html -
    -

    Weo weo

    -
    -``` - -```css -@font-face { - font-family: 'Glyphicons Halflings'; - src: url('../fonts/glyphicons-halflings-regular.eot'); - src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); -} -.glyphicon { - position: relative; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - font-style: normal; - font-weight: normal; - line-height: 1; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; -} -button[disabled], -html input[disabled] { - cursor: default; -} -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} -``` +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non libero tristique, interdum quam in, fermentum massa. Aenean vestibulum velit eu massa faucibus accumsan. Aenean tempus quam ornare ligula gravida adipiscing. Suspendisse vestibulum diam quis quam lacinia convallis. Nunc rhoncus a elit ut dictum. Maecenas porta mi et risus convallis commodo. In hac habitasse platea dictumst. Morbi placerat sem nec eleifend hendrerit. Donec hendrerit pulvinar tristique. Pellentesque at nunc blandit, fringilla elit nec, dignissim arcu. Quisque sit amet enim urna. Nunc adipiscing lacinia justo. Pellentesque euismod nisi id elit auctor porttitor. Phasellus rutrum viverra felis, ac cursus ante vulputate ut. Donec laoreet felis ac risus vulputate sodales. + +Mauris sit amet risus non ligula lacinia iaculis. Sed ornare tellus velit, vel elementum quam porttitor tempus. Duis vestibulum augue eu diam malesuada auctor. Maecenas dignissim odio ut elit fermentum, id mollis leo mattis. Phasellus posuere augue sed interdum vestibulum. Etiam ac pharetra est. Integer tortor ligula, pharetra ac nisi nec, faucibus laoreet dolor. Nunc vehicula, enim et cursus tincidunt, nulla purus mollis urna, vel ultricies nisl mi a risus. Vestibulum sed urna sodales, pretium nisi sed, pretium sapien. Vivamus et massa tincidunt, semper nibh nec, eleifend urna. Integer auctor, eros at pharetra blandit, erat nibh mattis turpis, rhoncus elementum nisi mi vitae purus. + +Quisque elementum sapien id neque volutpat cursus non mattis velit. + +```javascript +$mod : function ( qu, value ) { + var operands = sys.flatten( qu.operands ); + if ( operands.length !== 2 ) { + throw new Error( "$mod requires two operands" ); + } + var mod = operands[0]; + var rem = operands[1]; + return value % mod === rem; + }, +``` + +```bash +#!/bin/bash +echo Please, enter your firstname and lastname +read FN LN +echo "Hi! $LN, $FN !" +``` + +```html +
    +

    Weo weo

    +
    +``` + +```css +@font-face { + font-family: "Glyphicons Halflings"; + src: url("../fonts/glyphicons-halflings-regular.eot"); + src: url("../fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/glyphicons-halflings-regular.woff2") + format("woff2"), url("../fonts/glyphicons-halflings-regular.woff") format("woff"), url("../fonts/glyphicons-halflings-regular.ttf") + format("truetype"), url("../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg"); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: "Glyphicons Halflings"; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +``` diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/tutorials.json b/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/tutorials.json index ad5b558..6ca817c 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/tutorials.json +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/tutorials/tutorials.json @@ -1,17 +1,17 @@ -{ - "brush-teeth": { - "title": "Brush Teeth", - "summary": "How to brush your teeth!", - "children": { - "fence-test": { - "title": "Fence Test", - "summary": "Testing syntax highlighting.", - "showTableOfContents": false - } - } - }, - "drive-car": { - "title": "Drive Car", - "summary": "How to drive a car!" - } -} \ No newline at end of file +{ + "brush-teeth": { + "title": "Brush Teeth", + "summary": "How to brush your teeth!", + "children": { + "fence-test": { + "title": "Fence Test", + "summary": "Testing syntax highlighting.", + "showTableOfContents": false + } + } + }, + "drive-car": { + "title": "Drive Car", + "summary": "How to drive a car!" + } +} diff --git a/__DOCS__/JSDocTemplate/test-src/fixtures/utils/logger.js b/__DOCS__/JSDocTemplate/test-src/fixtures/utils/logger.js index ae0538c..0d3d4ee 100644 --- a/__DOCS__/JSDocTemplate/test-src/fixtures/utils/logger.js +++ b/__DOCS__/JSDocTemplate/test-src/fixtures/utils/logger.js @@ -1,89 +1,92 @@ -"use strict"; -/** - * @fileOverview The logging system for papyrus is based on [http://pimterry.github.io/loglevel/](loglevel) and slightly decorated - * @module utils/logger - * @requires dcl - * @requires loglevel - */ - -var dcl = require( "dcl" ); -var log = require( 'loglevel' ); - -/** - * A logger class that you can mix into your classes to handle logging settings and state at an object level. - * See {@link utils/logger} for the members of this class - * - * @exports utils/logger.Logger - * @class - * @see utils/logger - */ -var Logger = dcl( null, /** @lends utils/logger.Logger# */{ - declaredClass : "utils/Logger", - - /** - * Turn off all logging. If you log something, it will not error, but will not do anything either - * and the cycles are minimal. - * - */ - silent : function () { - log.disableAll(); - }, - /** - * Turns on all logging levels - * - */ - all : function () { - log.enableAll(); - }, - /** - * Sets the logging level to one of `trace`, `debug`, `info`, `warn`, `error`. - * @param {string} lvl The level to set it to. Can be one of `trace`, `debug`, `info`, `warn`, `error`. - * - */ - level : function ( lvl ) { - if ( lvl.toLowerCase() === "none" ) { - log.disableAll(); - } else { - log.setLevel( lvl ); - } - }, - /** - * Log a `trace` call - * @method - * @param {string} The value to log - */ - trace : log.trace, - /** - * Log a `debug` call - * @method - * @param {string} The value to log - */ - debug : log.debug, - /** - * Log a `info` call - * @method - * @param {string} The value to log - */ - info : log.info, - /** - * Log a `warn` call - * @method - * @param {string} The value to log - */ - warn : log.warn, - /** - * Log a `error` call - * @method - * @param {string} The value to log - */ - error : log.error -} ); - -module.exports = new Logger(); -/** - * The system global, cross-platform logger - * @name utils/logger - * @static - * @type {utils/logger.Logger} - */ -module.exports.Logger = Logger; +"use strict"; +/** + * @fileOverview The logging system for papyrus is based on [http://pimterry.github.io/loglevel/](loglevel) and slightly decorated + * @module utils/logger + * @requires dcl + * @requires loglevel + */ + +var dcl = require("dcl"); +var log = require("loglevel"); + +/** + * A logger class that you can mix into your classes to handle logging settings and state at an object level. + * See {@link utils/logger} for the members of this class + * + * @exports utils/logger.Logger + * @class + * @see utils/logger + */ +var Logger = dcl( + null, + /** @lends utils/logger.Logger# */ { + declaredClass: "utils/Logger", + + /** + * Turn off all logging. If you log something, it will not error, but will not do anything either + * and the cycles are minimal. + * + */ + silent: function () { + log.disableAll(); + }, + /** + * Turns on all logging levels + * + */ + all: function () { + log.enableAll(); + }, + /** + * Sets the logging level to one of `trace`, `debug`, `info`, `warn`, `error`. + * @param {string} lvl The level to set it to. Can be one of `trace`, `debug`, `info`, `warn`, `error`. + * + */ + level: function (lvl) { + if (lvl.toLowerCase() === "none") { + log.disableAll(); + } else { + log.setLevel(lvl); + } + }, + /** + * Log a `trace` call + * @method + * @param {string} The value to log + */ + trace: log.trace, + /** + * Log a `debug` call + * @method + * @param {string} The value to log + */ + debug: log.debug, + /** + * Log a `info` call + * @method + * @param {string} The value to log + */ + info: log.info, + /** + * Log a `warn` call + * @method + * @param {string} The value to log + */ + warn: log.warn, + /** + * Log a `error` call + * @method + * @param {string} The value to log + */ + error: log.error, + } +); + +module.exports = new Logger(); +/** + * The system global, cross-platform logger + * @name utils/logger + * @static + * @type {utils/logger.Logger} + */ +module.exports.Logger = Logger; diff --git a/__DOCS__/JSDocTemplate/test-src/inline.conf.json b/__DOCS__/JSDocTemplate/test-src/inline.conf.json index 9419852..d931e11 100644 --- a/__DOCS__/JSDocTemplate/test-src/inline.conf.json +++ b/__DOCS__/JSDocTemplate/test-src/inline.conf.json @@ -1,13 +1,13 @@ -{ - "tags": { - "allowUnknownTags": true - }, - "plugins": ["plugins/markdown"], - "templates": { - "inlineNav": true - }, - "markdown": { - "parser": "gfm", - "hardwrap": true - } -} +{ + "tags": { + "allowUnknownTags": true + }, + "plugins": ["plugins/markdown"], + "templates": { + "inlineNav": true + }, + "markdown": { + "parser": "gfm", + "hardwrap": true + } +} diff --git a/__DOCS__/JSDocTemplate/test-src/logo-color.conf.json b/__DOCS__/JSDocTemplate/test-src/logo-color.conf.json index 00dbe5d..d4e1eb3 100644 --- a/__DOCS__/JSDocTemplate/test-src/logo-color.conf.json +++ b/__DOCS__/JSDocTemplate/test-src/logo-color.conf.json @@ -1,15 +1,15 @@ -{ - "tags": { - "allowUnknownTags": true - }, - "plugins": ["plugins/markdown"], - "templates": { - "favicon": "./test-src/foobot-40x40.png", - "systemLogo": "./test-src/foobot-40x40.png", - "systemColor": "#5233b7" - }, - "markdown": { - "parser": "gfm", - "hardwrap": true - } -} +{ + "tags": { + "allowUnknownTags": true + }, + "plugins": ["plugins/markdown"], + "templates": { + "favicon": "./test-src/foobot-40x40.png", + "systemLogo": "./test-src/foobot-40x40.png", + "systemColor": "#5233b7" + }, + "markdown": { + "parser": "gfm", + "hardwrap": true + } +} diff --git a/__DOCS__/JSDocTemplate/test-src/namespaced/CustomError.js b/__DOCS__/JSDocTemplate/test-src/namespaced/CustomError.js index c109efe..a1fda80 100644 --- a/__DOCS__/JSDocTemplate/test-src/namespaced/CustomError.js +++ b/__DOCS__/JSDocTemplate/test-src/namespaced/CustomError.js @@ -1,13 +1,13 @@ -/** - * @summary A global custom error. - * @constructor CustomError - * @param {string} message - The message for the error. - * @description As this is just a test file there is no implementation of inheriting the Error.prototype or fixing of the stack trace, this is a dummy dummy object to test the documentation. - * @extends {Error} The default `Error` object. - * @example {@caption Use this class like any standard error object.} - * throw new CustomError("Oh no! It broke :("); - */ -function CustomError(message){ - this.name = "CustomError"; - this.message = message; -} \ No newline at end of file +/** + * @summary A global custom error. + * @constructor CustomError + * @param {string} message - The message for the error. + * @description As this is just a test file there is no implementation of inheriting the Error.prototype or fixing of the stack trace, this is a dummy dummy object to test the documentation. + * @extends {Error} The default `Error` object. + * @example {@caption Use this class like any standard error object.} + * throw new CustomError("Oh no! It broke :("); + */ +function CustomError(message) { + this.name = "CustomError"; + this.message = message; +} diff --git a/__DOCS__/JSDocTemplate/test-src/namespaced/GlobalClass.js b/__DOCS__/JSDocTemplate/test-src/namespaced/GlobalClass.js index eb7c4ac..c3a73b4 100644 --- a/__DOCS__/JSDocTemplate/test-src/namespaced/GlobalClass.js +++ b/__DOCS__/JSDocTemplate/test-src/namespaced/GlobalClass.js @@ -1,69 +1,64 @@ -/** - * @summary This is the summary of the global test class, test `markdown`. - * @constructor GlobalClass - * @param {string} arg1 - The first test arg, test `markdown`. - * @param {...string} [arg2=false] - A repeatable, optional argument with a default value of false, test `markdown`. - * @description This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test `markdown` - * @example {@caption You can provide example captions with `markdown` and specify the language to use when rendering the code, defaults to `javascript`.} - * var gc = new GlobalClass("arg1", "arg2"); - * @example {@lang xml} - * - * HTML Highlighting - * - * - */ -function GlobalClass(arg1, arg2){ - /** - * @summary The name of the class. - * @memberof GlobalClass# - * @name name - * @type {string} - * @default "Test Global" - */ - this.name = "Test Global"; - /** - * @summary A private member of the class. - * @memberof GlobalClass# - * @name _privateMember - * @type {string} - * @private - * @default "Test Global" - */ - this._privateMember = "Private Member"; -} - -/** - * @summary This is a test instance method of the global test class, test `markdown` - * @memberof GlobalClass# - * @function testMethod - * @param {*} value - Any value, test `markdown` - * @param {Object} obj - The first object of what could be many, test `markdown` - * @param {...Object} [objN] - Any additional objects, test `markdown` - * @returns {Object} The combination of all the objects, test `markdown`. - */ -GlobalClass.prototype.testMethod = function(value, obj, objN){ - -}; - -/** - * @summary This is a test instance method of the global test class to check that global type definitions are documented. - * @memberof GlobalClass# - * @function testMethod - * @param {SomeType} type - The parameter which is of type SomeType - */ -GlobalClass.prototype.testTypeDefMethod = function(type){ - -}; - -window.GlobalClass = GlobalClass; - - -/** - * Some global type. - * @global - * @typedef {Object} SomeType - * @property {string} someProp - */ \ No newline at end of file +/** + * @summary This is the summary of the global test class, test `markdown`. + * @constructor GlobalClass + * @param {string} arg1 - The first test arg, test `markdown`. + * @param {...string} [arg2=false] - A repeatable, optional argument with a default value of false, test `markdown`. + * @description This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test `markdown` + * @example {@caption You can provide example captions with `markdown` and specify the language to use when rendering the code, defaults to `javascript`.} + * var gc = new GlobalClass("arg1", "arg2"); + * @example {@lang xml} + * + * HTML Highlighting + * + * + */ +function GlobalClass(arg1, arg2) { + /** + * @summary The name of the class. + * @memberof GlobalClass# + * @name name + * @type {string} + * @default "Test Global" + */ + this.name = "Test Global"; + /** + * @summary A private member of the class. + * @memberof GlobalClass# + * @name _privateMember + * @type {string} + * @private + * @default "Test Global" + */ + this._privateMember = "Private Member"; +} + +/** + * @summary This is a test instance method of the global test class, test `markdown` + * @memberof GlobalClass# + * @function testMethod + * @param {*} value - Any value, test `markdown` + * @param {Object} obj - The first object of what could be many, test `markdown` + * @param {...Object} [objN] - Any additional objects, test `markdown` + * @returns {Object} The combination of all the objects, test `markdown`. + */ +GlobalClass.prototype.testMethod = function (value, obj, objN) {}; + +/** + * @summary This is a test instance method of the global test class to check that global type definitions are documented. + * @memberof GlobalClass# + * @function testMethod + * @param {SomeType} type - The parameter which is of type SomeType + */ +GlobalClass.prototype.testTypeDefMethod = function (type) {}; + +window.GlobalClass = GlobalClass; + +/** + * Some global type. + * @global + * @typedef {Object} SomeType + * @property {string} someProp + */ diff --git a/__DOCS__/JSDocTemplate/test-src/namespaced/MyApi.js b/__DOCS__/JSDocTemplate/test-src/namespaced/MyApi.js index 0172251..92de47e 100644 --- a/__DOCS__/JSDocTemplate/test-src/namespaced/MyApi.js +++ b/__DOCS__/JSDocTemplate/test-src/namespaced/MyApi.js @@ -1,165 +1,165 @@ -/** - * @summary This is the test summary for the `MyApi` namespace. - * @namespace MyApi - * @description This is the longer description for the namespace giving a better idea about the code contained within it. - */ -window.MyApi = { - /** - * @summary This is a static member of the namespace. - * @memberof MyApi. - * @name staticMember - * @type {string} - * @default I'm a member of the MyApi namespace. - */ - staticMember: "I'm a member of the MyApi namespace." -}; - -/** - * @summary This is a test type definition on the MyApi namespace. - * @memberof MyApi~ - * @typedef {Object} Object - * @prop {string} name - This is the name of the test object. - * @prop {boolean} [enabled=false] - This is whether or not the test object is enabled. Defaults to `false`. - */ - -/** - * @summary This is the summary of the MyApi test class, test `markdown`. - * @memberof MyApi - * @constructor Class - * @param {string} arg1 - The first test arg, test `markdown`. - * @param {...string} [arg2=false] - A repeatable, optional argument with a default value of false, test `markdown`. - * @description This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test `markdown` - * @example {@caption You can provide example captions with `markdown` and specify the language to use when rendering the code, defaults to `javascript`.} - * var gc = new GlobalClass("arg1", "arg2"); - * @example {@lang xml} - * - * HTML Highlighting - * - * - */ -MyApi.Class = function(arg1, arg2){ - /** - * @summary I'm a member of the class. - * @memberof MyApi.Class# - * @name publicMember - * @type {string} - * @default "I'm an instance member." - */ - this.publicMember = "I'm an instance member."; - /** - * @summary I'm a protected member of the class. - * @memberof MyApi.Class# - * @name protectedMember - * @type {string} - * @default "I'm a protected member." - * @protected - */ - this.protectedMember = "I'm a protected member."; - /** - * @summary I'm a private member of the class. - * @memberof MyApi.Class# - * @name _privateMember - * @type {string} - * @default "I'm a private member." - * @private - */ - this._privateMember = "I'm a private member."; -}; - -/** - * @summary This is a test instance method of the MyApi test class, test `markdown`. - * @memberof MyApi.Class# - * @function testMethod - * @param {*} value - Any value, test `markdown` - * @param {Object} obj - The first object of what could be many, test `markdown` - * @param {...Object} [objN] - Any additional objects, test `markdown` - * @returns {Object} The combination of all the objects, test `markdown`. - * @description This method is not overridden in the {@link MyApi.Child} class but is simply inherited. - * @fires MyApi.Class~"test.my-api" - * @throws {CustomError} This is thrown when some condition fails within this method. - */ -MyApi.Class.prototype.testMethod = function(value, obj, objN){ - /** - * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope. - * @memberof MyApi.Class~ - * @event "test.my-api" - * @param {Event} e - The event object. - * @param {*} custom - Some custom parameter passed to any listeners. - */ - throw new CustomError("Some custom error."); -}; - -/** - * @summary This is a another test instance method of the MyApi test class, test `markdown`. - * @memberof MyApi.Class# - * @function anotherMethod - * @param {*} value - Any value, test `markdown` - * @param {Object} obj - The first object of what could be many, test `markdown` - * @param {...Object} [objN] - Any additional objects, test `markdown` - * @returns {Object} The combination of all the objects, test `markdown`. - * @description This method is overridden in the {@link MyApi.Child} class and should remove the exception documentation as it no longer applies. - * @fires MyApi.Class~"another.my-api" - * @throws {CustomError} This is thrown when some condition fails within this method. - */ -MyApi.Class.prototype.anotherMethod = function(value, obj, objN){ - /** - * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope. - * @memberof MyApi.Class~ - * @event "another.my-api" - * @param {Event} e - The event object. - * @param {*} custom - Some custom parameter passed to any listeners. - */ -}; - -/** - * @summary This is a test type definition on the MyApi.Class class. - * @memberof MyApi.Class~ - * @typedef {Object} Object - * @prop {string} name - The name of the test object. - * @prop {boolean} [enabled=false] - Whether or not the test object is enabled. Defaults to `false`. - * @prop {Object} sub - An object containing a subset of properties. - * @prop {number} sub.id - The subset id. - * @prop {boolean} [sub.name="Sub Options"] - The name of the sub object. Defaults to `"Sub Options"`. - */ - -/** - * @summary This is the summary of the MyApi child class, test `markdown`. - * @memberof MyApi - * @constructor Child - * @extends MyApi.Class - */ -MyApi.Child = function(){ - /** - * @summary I'm a protected member of the class. - * @memberof MyApi.Child# - * @name protectedMember - * @type {string} - * @default "I'm a protected member." - * @protected - */ - this.protectedMember = "I'm a protected member."; -}; - -/** - * @summary This is a another test instance method of the MyApi child class, test `markdown`. - * @memberof MyApi.Child# - * @function anotherMethod - * @param {*} value - Any value, test `markdown` - * @param {Object} obj - The first object of what could be many, test `markdown` - * @param {...Object} [objN] - Any additional objects, test `markdown` - * @returns {Object} The combination of all the objects, test `markdown`. - * @description This method overrides the {@link MyApi.Class#anotherMethod} and should remove the exception documentation as it no longer applies. The event should also be updated to reflect it is raised by this class and not the inherited one. - * @fires MyApi.Child~"another.my-api" - */ -MyApi.Child.prototype.anotherMethod = function(value, obj, objN){ - /** - * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope. - * @memberof MyApi.Child~ - * @event "another.my-api" - * @param {Event} e - The event object. - * @param {*} custom - Some custom parameter passed to any listeners. - */ -}; \ No newline at end of file +/** + * @summary This is the test summary for the `MyApi` namespace. + * @namespace MyApi + * @description This is the longer description for the namespace giving a better idea about the code contained within it. + */ +window.MyApi = { + /** + * @summary This is a static member of the namespace. + * @memberof MyApi. + * @name staticMember + * @type {string} + * @default I'm a member of the MyApi namespace. + */ + staticMember: "I'm a member of the MyApi namespace.", +}; + +/** + * @summary This is a test type definition on the MyApi namespace. + * @memberof MyApi~ + * @typedef {Object} Object + * @prop {string} name - This is the name of the test object. + * @prop {boolean} [enabled=false] - This is whether or not the test object is enabled. Defaults to `false`. + */ + +/** + * @summary This is the summary of the MyApi test class, test `markdown`. + * @memberof MyApi + * @constructor Class + * @param {string} arg1 - The first test arg, test `markdown`. + * @param {...string} [arg2=false] - A repeatable, optional argument with a default value of false, test `markdown`. + * @description This is the description for the class this is meant to be a more in depth explanation of what this class does and it's general use case, test `markdown` + * @example {@caption You can provide example captions with `markdown` and specify the language to use when rendering the code, defaults to `javascript`.} + * var gc = new GlobalClass("arg1", "arg2"); + * @example {@lang xml} + * + * HTML Highlighting + * + * + */ +MyApi.Class = function (arg1, arg2) { + /** + * @summary I'm a member of the class. + * @memberof MyApi.Class# + * @name publicMember + * @type {string} + * @default "I'm an instance member." + */ + this.publicMember = "I'm an instance member."; + /** + * @summary I'm a protected member of the class. + * @memberof MyApi.Class# + * @name protectedMember + * @type {string} + * @default "I'm a protected member." + * @protected + */ + this.protectedMember = "I'm a protected member."; + /** + * @summary I'm a private member of the class. + * @memberof MyApi.Class# + * @name _privateMember + * @type {string} + * @default "I'm a private member." + * @private + */ + this._privateMember = "I'm a private member."; +}; + +/** + * @summary This is a test instance method of the MyApi test class, test `markdown`. + * @memberof MyApi.Class# + * @function testMethod + * @param {*} value - Any value, test `markdown` + * @param {Object} obj - The first object of what could be many, test `markdown` + * @param {...Object} [objN] - Any additional objects, test `markdown` + * @returns {Object} The combination of all the objects, test `markdown`. + * @description This method is not overridden in the {@link MyApi.Child} class but is simply inherited. + * @fires MyApi.Class~"test.my-api" + * @throws {CustomError} This is thrown when some condition fails within this method. + */ +MyApi.Class.prototype.testMethod = function (value, obj, objN) { + /** + * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope. + * @memberof MyApi.Class~ + * @event "test.my-api" + * @param {Event} e - The event object. + * @param {*} custom - Some custom parameter passed to any listeners. + */ + throw new CustomError("Some custom error."); +}; + +/** + * @summary This is a another test instance method of the MyApi test class, test `markdown`. + * @memberof MyApi.Class# + * @function anotherMethod + * @param {*} value - Any value, test `markdown` + * @param {Object} obj - The first object of what could be many, test `markdown` + * @param {...Object} [objN] - Any additional objects, test `markdown` + * @returns {Object} The combination of all the objects, test `markdown`. + * @description This method is overridden in the {@link MyApi.Child} class and should remove the exception documentation as it no longer applies. + * @fires MyApi.Class~"another.my-api" + * @throws {CustomError} This is thrown when some condition fails within this method. + */ +MyApi.Class.prototype.anotherMethod = function (value, obj, objN) { + /** + * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope. + * @memberof MyApi.Class~ + * @event "another.my-api" + * @param {Event} e - The event object. + * @param {*} custom - Some custom parameter passed to any listeners. + */ +}; + +/** + * @summary This is a test type definition on the MyApi.Class class. + * @memberof MyApi.Class~ + * @typedef {Object} Object + * @prop {string} name - The name of the test object. + * @prop {boolean} [enabled=false] - Whether or not the test object is enabled. Defaults to `false`. + * @prop {Object} sub - An object containing a subset of properties. + * @prop {number} sub.id - The subset id. + * @prop {boolean} [sub.name="Sub Options"] - The name of the sub object. Defaults to `"Sub Options"`. + */ + +/** + * @summary This is the summary of the MyApi child class, test `markdown`. + * @memberof MyApi + * @constructor Child + * @extends MyApi.Class + */ +MyApi.Child = function () { + /** + * @summary I'm a protected member of the class. + * @memberof MyApi.Child# + * @name protectedMember + * @type {string} + * @default "I'm a protected member." + * @protected + */ + this.protectedMember = "I'm a protected member."; +}; + +/** + * @summary This is a another test instance method of the MyApi child class, test `markdown`. + * @memberof MyApi.Child# + * @function anotherMethod + * @param {*} value - Any value, test `markdown` + * @param {Object} obj - The first object of what could be many, test `markdown` + * @param {...Object} [objN] - Any additional objects, test `markdown` + * @returns {Object} The combination of all the objects, test `markdown`. + * @description This method overrides the {@link MyApi.Class#anotherMethod} and should remove the exception documentation as it no longer applies. The event should also be updated to reflect it is raised by this class and not the inherited one. + * @fires MyApi.Child~"another.my-api" + */ +MyApi.Child.prototype.anotherMethod = function (value, obj, objN) { + /** + * @summary This is an event raised by this class, it's documentation appears on this page as the event is specified as an inner member the class by using the tilde (~) scope. + * @memberof MyApi.Child~ + * @event "another.my-api" + * @param {Event} e - The event object. + * @param {*} custom - Some custom parameter passed to any listeners. + */ +}; diff --git a/__DOCS__/JSDocTemplate/test-src/namespaced/MyApi.utils.js b/__DOCS__/JSDocTemplate/test-src/namespaced/MyApi.utils.js index fb9bc03..51eaddf 100644 --- a/__DOCS__/JSDocTemplate/test-src/namespaced/MyApi.utils.js +++ b/__DOCS__/JSDocTemplate/test-src/namespaced/MyApi.utils.js @@ -1,21 +1,19 @@ -/** - * @summary This is to test child namespaces. - * @memberof MyApi. - * @namespace utils - */ -MyApi.utils = {}; - -/** - * @summary Formats the supplied `str` with the given replacement args and there indexes. - * @memberof MyApi.utils. - * @function format - * @param {string} str - The format string. - * @param {*} arg - The first of argument to format into the string. - * @param {...*} [argN] - Any number of additional arguments. - * @returns {string} The given `str` formatted with the supplied arguments. - * @example {@caption Basic usage:} - * var result = MyApi.utils.format( "Hello {0}! My name is {1}.", "Jill", "Jack" ); // => "Hello Jill! My name is Jack." - */ -MyApi.utils.format = function(str, arg, argN){ - -}; \ No newline at end of file +/** + * @summary This is to test child namespaces. + * @memberof MyApi. + * @namespace utils + */ +MyApi.utils = {}; + +/** + * @summary Formats the supplied `str` with the given replacement args and there indexes. + * @memberof MyApi.utils. + * @function format + * @param {string} str - The format string. + * @param {*} arg - The first of argument to format into the string. + * @param {...*} [argN] - Any number of additional arguments. + * @returns {string} The given `str` formatted with the supplied arguments. + * @example {@caption Basic usage:} + * var result = MyApi.utils.format( "Hello {0}! My name is {1}.", "Jill", "Jack" ); // => "Hello Jill! My name is Jack." + */ +MyApi.utils.format = function (str, arg, argN) {}; diff --git a/__DOCS__/examples/annotatedExamples/annotatedExamples.md b/__DOCS__/examples/annotatedExamples/annotatedExamples.md index eb5d7c5..b73ec8f 100644 --- a/__DOCS__/examples/annotatedExamples/annotatedExamples.md +++ b/__DOCS__/examples/annotatedExamples/annotatedExamples.md @@ -1,2 +1 @@ This page references a list of annotated code examples
    - diff --git a/__DOCS__/examples/annotatedExamples/configuration.md b/__DOCS__/examples/annotatedExamples/configuration.md index 814b7de..1d9c0d3 100644 --- a/__DOCS__/examples/annotatedExamples/configuration.md +++ b/__DOCS__/examples/annotatedExamples/configuration.md @@ -2,15 +2,15 @@ ```javascript // Import the cloudinary class -import {Cloudinary} from "@cloudinary/url-gen/instance/Cloudinary"; +import { Cloudinary } from "@cloudinary/url-gen/instance/Cloudinary"; // Create your instance const cld = new Cloudinary({ - cloud: { - cloudName: 'demo' - }, - url: { - secure: true // force https, set to false to force http - } + cloud: { + cloudName: "demo", + }, + url: { + secure: true, // force https, set to false to force http + }, }); ``` diff --git a/__DOCS__/examples/annotatedExamples/imageOverlay.md b/__DOCS__/examples/annotatedExamples/imageOverlay.md index 86c7f01..01dfab0 100644 --- a/__DOCS__/examples/annotatedExamples/imageOverlay.md +++ b/__DOCS__/examples/annotatedExamples/imageOverlay.md @@ -1,45 +1,44 @@ ```javascript // Import the cloudinary class -import {Cloudinary} from "@cloudinary/url-gen/instance/Cloudinary"; +import { Cloudinary } from "@cloudinary/url-gen/instance/Cloudinary"; // Create your instance const cld = new Cloudinary({ cloud: { - cloudName: 'demo' + cloudName: "demo", }, url: { - secure: true // force https, set to false to force http - } + secure: true, // force https, set to false to force http + }, }); // Lets create a new image -const myImage = cld.image('sample'); +const myImage = cld.image("sample"); // An overlay is built from several parts // Import video or image overlay, based on your asset -import {Overlay} from "@cloudinary/url-gen/actions/overlay"; +import { Overlay } from "@cloudinary/url-gen/actions/overlay"; // Import the source of the layer, this determines if the layer is an image, text or video -import {image} from "@cloudinary/url-gen/qualifiers/source"; +import { image } from "@cloudinary/url-gen/qualifiers/source"; // Import how to position your layer -import {Position} from "@cloudinary/url-gen/qualifiers/position"; -import {southEast} from "@cloudinary/url-gen/qualifiers/compass"; -import {compass} from "@cloudinary/url-gen/qualifiers/gravity"; +import { Position } from "@cloudinary/url-gen/qualifiers/position"; +import { southEast } from "@cloudinary/url-gen/qualifiers/compass"; +import { compass } from "@cloudinary/url-gen/qualifiers/gravity"; // We'll also scale our overlay, we'll need this for later. -import {scale} from "@cloudinary/url-gen/actions/resize"; -import {Transformation} from "@cloudinary/url-gen/transformation/Transformation"; - +import { scale } from "@cloudinary/url-gen/actions/resize"; +import { Transformation } from "@cloudinary/url-gen/transformation/Transformation"; myImage.overlay( - Overlay.source( // An overlay has a Source and a Position Qualifiers - image('cloudinary_icon') // Mandatory - Source - .transformation(new Transformation() - .resize(scale().width(300).height(300)) // A source can be transformed like an image - )) - .position(new Position().gravity(compass(southEast())) - ), -) + Overlay.source( + // An overlay has a Source and a Position Qualifiers + image("cloudinary_icon") // Mandatory - Source + .transformation( + new Transformation().resize(scale().width(300).height(300)) // A source can be transformed like an image + ) + ).position(new Position().gravity(compass(southEast()))) +); myImage.toString(); // l_cloudinary_icon/c_scale,h_300,w_300/fl_layer_apply,g_south_east ``` diff --git a/__DOCS__/examples/annotatedExamples/resize.md b/__DOCS__/examples/annotatedExamples/resize.md index 7364826..51c142c 100644 --- a/__DOCS__/examples/annotatedExamples/resize.md +++ b/__DOCS__/examples/annotatedExamples/resize.md @@ -1,19 +1,19 @@ ```javascript // Import the cloudinary class -import {Cloudinary} from "@cloudinary/url-gen/instance/Cloudinary"; +import { Cloudinary } from "@cloudinary/url-gen/instance/Cloudinary"; // Create your instance const cld = new Cloudinary({ - cloud: { - cloudName: 'demo' - }, - url: { - secure: true // force https, set to false to force http - } + cloud: { + cloudName: "demo", + }, + url: { + secure: true, // force https, set to false to force http + }, }); // Lets create a new image -const myImage = cld.image('sample'); +const myImage = cld.image("sample"); // The image interface exposes a lot of useful functions we call ActionGroups // Each ActionGroup accepts a matching Action as a parameter @@ -23,13 +23,12 @@ const myImage = cld.image('sample'); // This doesn't make much sense on its own // myImage.resize(); - // the resize() ActionGroup needs an Action parameter // Lets give resize() a ResizeScale paramter to scale our image // We import all of our Action parameters from @cloudinary/url-gen/actions/{actionGroup} // Note that you can import all Resize Actions, or just the single one you want -import {Resize} from "@cloudinary/url-gen/actions/resize"; -const {scale} = Resize; +import { Resize } from "@cloudinary/url-gen/actions/resize"; +const { scale } = Resize; // Resize.scale === scale // Explore the Resize object to discover more resize actions diff --git a/__DOCS__/examples/annotatedExamples/rotate.md b/__DOCS__/examples/annotatedExamples/rotate.md index 7821d83..0fa6bca 100644 --- a/__DOCS__/examples/annotatedExamples/rotate.md +++ b/__DOCS__/examples/annotatedExamples/rotate.md @@ -1,18 +1,17 @@ ```javascript -import {Cloudinary} from "@cloudinary/url-gen/instance/Cloudinary"; +import { Cloudinary } from "@cloudinary/url-gen/instance/Cloudinary"; const cld = new Cloudinary({ - cloud: { - cloudName: 'demo' - }, - url: { - secure: true // force https, set to false to force http - } + cloud: { + cloudName: "demo", + }, + url: { + secure: true, // force https, set to false to force http + }, }); - // Import the RotationModeAction -import {mode} from '@cloudinary/url-gen/actions/rotate'; +import { mode } from "@cloudinary/url-gen/actions/rotate"; // Remember, mode is a function that returns an Action // but we refer to both as a RotationMode action @@ -20,13 +19,13 @@ import {mode} from '@cloudinary/url-gen/actions/rotate'; // The RotationModeAction (mode) requires a Qualifier // That qualifier will require a certain QualifierValue // To make life easier, you can import all possible QualifierValue(s) of rotate -import {RotationMode} from '@cloudinary/url-gen/qualifiers/rotationMode'; +import { RotationMode } from "@cloudinary/url-gen/qualifiers/rotationMode"; // You can also import only the required QualifierValue you want -import {verticalFlip} from '@cloudinary/url-gen/qualifiers/rotationMode'; +import { verticalFlip } from "@cloudinary/url-gen/qualifiers/rotationMode"; // RotationMode.verticalFlip === verticalFlip -const myImage = cld.image('sample'); +const myImage = cld.image("sample"); // rotate() accepts a RotationModeAction (mode) // mode() has a Qualifier, however because that Qualifier is mandatory, we pass it directly to the factory diff --git a/__DOCS__/examples/gettingStarted/helloworld.md b/__DOCS__/examples/gettingStarted/helloworld.md index 001118a..ede0439 100644 --- a/__DOCS__/examples/gettingStarted/helloworld.md +++ b/__DOCS__/examples/gettingStarted/helloworld.md @@ -3,32 +3,26 @@

    Code Example

    ```javascript -import {Cloudinary} from "@cloudinary/url-gen/instance/Cloudinary"; -import {scale} from "@cloudinary/url-gen/actions/resize"; +import { Cloudinary } from "@cloudinary/url-gen/instance/Cloudinary"; +import { scale } from "@cloudinary/url-gen/actions/resize"; // Create your instance const cld = new Cloudinary({ - cloud: { - cloudName: 'demo' - }, - url: { - secure: true // force https, set to false to force http - } + cloud: { + cloudName: "demo", + }, + url: { + secure: true, // force https, set to false to force http + }, }); - // Create a new image -const myImage = cld.image('sample'); +const myImage = cld.image("sample"); -myImage.resize( - scale() - .width(100) - .height(100) -); +myImage.resize(scale().width(100).height(100)); const myURL = myImage.toString(); // End result: c_scale,w_100,h_100 - ```

    Explanation

    diff --git a/__DOCS__/examples/gettingStarted/terminology.md b/__DOCS__/examples/gettingStarted/terminology.md index 9172cec..688e2ef 100644 --- a/__DOCS__/examples/gettingStarted/terminology.md +++ b/__DOCS__/examples/gettingStarted/terminology.md @@ -2,34 +2,25 @@

    The best way to explain our terminology is through an example

    - ```javascript -import {Cloudinary} from "@cloudinary/url-gen/instance/Cloudinary"; -import {Rotate} from "@cloudinary/url-gen/actions/rotate"; -import {Resize} from "@cloudinary/url-gen/actions/resize"; -import {RotationMode} from "@cloudinary/url-gen/qualifiers/rotationMode"; +import { Cloudinary } from "@cloudinary/url-gen/instance/Cloudinary"; +import { Rotate } from "@cloudinary/url-gen/actions/rotate"; +import { Resize } from "@cloudinary/url-gen/actions/resize"; +import { RotationMode } from "@cloudinary/url-gen/qualifiers/rotationMode"; // Create your instance const cld = new Cloudinary({ - cloud: { - cloudName: 'demo' - }, - url: { - secure: true // force https, set to false to force http - } + cloud: { + cloudName: "demo", + }, + url: { + secure: true, // force https, set to false to force http + }, }); +const myImage = cld.image("sample"); -const myImage = cld.image('sample'); - -myImage - .resize( - Resize.scale() - .width(100) - .height(100)) - .rotate( - Rotate.mode(RotationMode.verticalFlip()) - ); +myImage.resize(Resize.scale().width(100).height(100)).rotate(Rotate.mode(RotationMode.verticalFlip())); ```

    Cloudinary Instance & Configuration

    @@ -49,7 +40,6 @@ myImage
  • You can import all actions from import {Actions} from '@cloudinary/url-gen' -

    Qualifiers and QualifierValues

    • Actions expose methods to define their behaviours diff --git a/__DOCS__/examples/gettingStarted/treeShaking.md b/__DOCS__/examples/gettingStarted/treeShaking.md index 7606315..719565a 100644 --- a/__DOCS__/examples/gettingStarted/treeShaking.md +++ b/__DOCS__/examples/gettingStarted/treeShaking.md @@ -1,26 +1,25 @@ ### Treeshaking and performance + - -
      Tree shaking is available throughout the SDK.
      Everything can be very granularly imported to ensure you only import what you need.
      -

      Actions

      Without Tree-Shaking

      - ```javascript - import {Resize} from "@cloudinary/url-gen/actions/resize"; - - Resize.scale() - Resize.crop() - ``` +```javascript +import { Resize } from "@cloudinary/url-gen/actions/resize"; + +Resize.scale(); +Resize.crop(); +``` +

      With Tree-Shaking

      ```javascript @@ -36,12 +35,13 @@ Everything can be very granularly imported to ensure you only import what you ne

      Qualifier Values

      Without Tree-Shaking

      - ```javascript - import {Format} from "@cloudinary/url-gen/qualifiers/format"; - - Format.png() - Format.jpg() - ``` +```javascript +import { Format } from "@cloudinary/url-gen/qualifiers/format"; + +Format.png(); +Format.jpg(); +``` +

      With Tree-Shaking

      ```javascript diff --git a/__DOCS__/examples/tutorials.json b/__DOCS__/examples/tutorials.json index ee523fb..cca0ae0 100644 --- a/__DOCS__/examples/tutorials.json +++ b/__DOCS__/examples/tutorials.json @@ -1,13 +1,9 @@ { "gettingStarted": { "title": "Getting started", - "children": [ - "installation", - "helloworld", - "terminology" - ] + "children": ["installation", "helloworld", "terminology"] }, - "installation" : { + "installation": { "title": "Installation" }, "helloworld": { @@ -22,20 +18,20 @@ "treeShaking": { "title": "Tree shaking" }, - "annotatedExamples" : { + "annotatedExamples": { "title": "Annotated Code Examples", "children": ["resize", "rotate", "imageOverlay"] }, - "imageOverlay" : { + "imageOverlay": { "title": "Image overlay on an Image" }, - "resize" : { + "resize": { "title": "Resize" }, - "rotate" : { + "rotate": { "title": "Rotate" }, - "configuration" : { + "configuration": { "title": "Configuration" } } diff --git a/__DOCS__/resources/customStyles.css b/__DOCS__/resources/customStyles.css index ff47769..f9d35a2 100644 --- a/__DOCS__/resources/customStyles.css +++ b/__DOCS__/resources/customStyles.css @@ -2,42 +2,45 @@ Custom CSS for the JSDOC template */ -.container .kind{ - display:none; +.container .kind { + display: none; } /** Set colors to cloudinary theme */ .page-header { - background-color: #3448C5 !important; + background-color: #3448c5 !important; } /** Set colors to cloudinary theme */ .breadcrumb li a { - color: #FF5050!important; + color: #ff5050 !important; } /** Set colors to cloudinary theme */ -.toc .nav>li.active>a, .toc .nav>li.active>a:focus, .toc .nav>li.active>a:hover { - color: #FF5050!important; - border-left: 2px solid #3448C5!important; +.toc .nav > li.active > a, +.toc .nav > li.active > a:focus, +.toc .nav > li.active > a:hover { + color: #ff5050 !important; + border-left: 2px solid #3448c5 !important; } /** Set colors of buttons to cloudinary theme */ -.symbol-title .name-signature, .symbol-title .signature-params { - color: #0c163b!important; +.symbol-title .name-signature, +.symbol-title .signature-params { + color: #0c163b !important; } /** Set colors of buttons to cloudinary theme */ .back-to-top { - color: #5A616A!important; + color: #5a616a !important; } /** @@ -52,53 +55,53 @@ Custom CSS for the JSDOC template Set colors of buttons to cloudinary theme */ .symbol-title.collapsible-symbol .toggle-icon { - color: #3448C5!important; - text-indent: 0!important; + color: #3448c5 !important; + text-indent: 0 !important; } /** Set colors to cloudinary theme */ .callout-primary { - border-left-color: #3448C5!important; + border-left-color: #3448c5 !important; } /** Set colors to cloudinary theme */ .callout-primary h5 { - color: #3448C5!important; + color: #3448c5 !important; } /** Set colors to cloudinary theme */ body { - color: #0c163b!important; + color: #0c163b !important; } /** Set colors to cloudinary theme */ -.toc .nav>li>a .name-signature, .toc .nav>li>a .signature-params { - color: #0c163b!important; +.toc .nav > li > a .name-signature, +.toc .nav > li > a .signature-params { + color: #0c163b !important; } /** Set colors to cloudinary theme */ .callout-default { - border-left-color: #5A616A!important; + border-left-color: #5a616a !important; } /** Set sizes to cloudinary theme */ .branding-logo { - background-size:30px; + background-size: 30px; } - /** * CONTROL THE SEARCH RESULTS, PILLS, FORMATTING ETC, */ @@ -110,12 +113,12 @@ body { } .lunr-search-result-pill { - border:1px solid grey; - border-radius:15px; - padding-left:5px; - padding-right:5px; - margin-right:5px; - color:grey; + border: 1px solid grey; + border-radius: 15px; + padding-left: 5px; + padding-right: 5px; + margin-right: 5px; + color: grey; display: inline-block; min-width: 64px; font-size: 10px; @@ -123,34 +126,34 @@ body { } .lunr-search-result-pill.action { - border:1px solid black; - background-color:green; - color:white; + border: 1px solid black; + background-color: green; + color: white; } .lunr-search-result-pill.qualifier { - border:1px solid black; - background-color:teal; - color:white; + border: 1px solid black; + background-color: teal; + color: white; } .lunr-search-result-pill.namespace { - border:1px solid black; - background-color:darkorange; - color:white; + border: 1px solid black; + background-color: darkorange; + color: white; } .lunr-search-result-pill.sdk { - border:1px solid black; + border: 1px solid black; background-color: #2d2d2d; - color:white; + color: white; } .lunr-search-result-pill.config { - border:1px solid black; + border: 1px solid black; background-color: lightpink; } .lunr-search-result-pill.test { - border:1px solid black; + border: 1px solid black; background-color: mediumpurple; color: white; } @@ -159,7 +162,7 @@ body { * ENSURE ALL RIGHT-SIDE MENUS ARE ALWAYS OPEN */ .toc .nav .nav { - display:block!important; + display: block !important; } /** @@ -177,15 +180,15 @@ body { * Support left-right columns in the search */ .modal-body { - display:flex; + display: flex; } .modal-dialog { - width:900px; + width: 900px; } .modal-body__left { - width:500px; + width: 500px; } .modal-body__right { width: 350px; @@ -199,16 +202,14 @@ body { } .pill-legend { - padding-bottom:15px; + padding-bottom: 15px; } - - /** Hide the prefix in method names */ .signature-attribs { - display:none; + display: none; } /** @@ -221,7 +222,7 @@ body { Hide the Return statement of methods */ .callout-success { - display:none; + display: none; } /** @@ -236,15 +237,14 @@ body { * Fix indentation */ .symbol-details .form-horizontal .control-label { - text-align:left; + text-align: left; } - /** * In the @example tags, we can use to provide titles to the examples * Since we use title h tags (

      for example), these get anchor tags added to them * These interfere with the look & feel, so we're hiding them */ .example-caption .anchor-link { - display:none; + display: none; } diff --git a/__TESTS_BUNDLE_SIZE__/bin/bin.ts b/__TESTS_BUNDLE_SIZE__/bin/bin.ts index a696c63..41ee83b 100644 --- a/__TESTS_BUNDLE_SIZE__/bin/bin.ts +++ b/__TESTS_BUNDLE_SIZE__/bin/bin.ts @@ -4,7 +4,6 @@ import log from "../utils/log"; import testCleanUp from "../utils/fileSystem/testCleanUp"; import bundleSizeTestRunner from "../bundleSizeTestRunner"; - /** * Executable entrypoint for the BundleSizeTests * Run with `npm run test:size` @@ -41,5 +40,3 @@ bundleSizeTestRunner() // Exit the process process.exit(1); }); - - diff --git a/__TESTS_BUNDLE_SIZE__/bundleSizeTestCases.ts b/__TESTS_BUNDLE_SIZE__/bundleSizeTestCases.ts index adc1a61..d14d7eb 100644 --- a/__TESTS_BUNDLE_SIZE__/bundleSizeTestCases.ts +++ b/__TESTS_BUNDLE_SIZE__/bundleSizeTestCases.ts @@ -4,7 +4,7 @@ */ import importFromDist from "./utils/stringGenerators/importFromDist"; -import {ITestCase} from "./interfaces/ITestCase"; +import { ITestCase } from "./interfaces/ITestCase"; import importFromPackage from "./utils/stringGenerators/importFromPackage"; /** @@ -12,60 +12,50 @@ import importFromPackage from "./utils/stringGenerators/importFromPackage"; * Each element in the array is string, an import statement: `import resize from '...'; console.log(resize)` * Before we export, we combine all those strings into one long string, contained within importString; */ -const bundleSizeTestCases:ITestCase[] = [ +const bundleSizeTestCases: ITestCase[] = [ { - name: 'Tests Overlay imports', + name: "Tests Overlay imports", sizeLimitInKB: 29, importsArray: [ - importFromDist('actions/overlay', 'Overlay'), - importFromDist('qualifiers/source', 'Source'), - importFromDist('transformation/Transformation', 'Transformation'), - importFromDist('actions/resize', 'crop') - ] + importFromDist("actions/overlay", "Overlay"), + importFromDist("qualifiers/source", "Source"), + importFromDist("transformation/Transformation", "Transformation"), + importFromDist("actions/resize", "crop"), + ], }, { - name: 'Import backwards compatibility function', + name: "Import backwards compatibility function", sizeLimitInKB: 45, - importsArray: [ - importFromPackage('createCloudinaryLegacyURL') - ] + importsArray: [importFromPackage("createCloudinaryLegacyURL")], }, { - name: 'Import all of the SDK', + name: "Import all of the SDK", sizeLimitInKB: 128, - importsArray: [ - importFromPackage('* as CloudinaryURLGEN') - ] + importsArray: [importFromPackage("* as CloudinaryURLGEN")], }, { - name: 'Import a Transformation Object', + name: "Import a Transformation Object", sizeLimitInKB: 7, - importsArray: [ - importFromPackage('Transformation') - ] + importsArray: [importFromPackage("Transformation")], }, { - name: 'Import All Actions', + name: "Import All Actions", sizeLimitInKB: 60, - importsArray: [ - importFromPackage('Actions') - ] + importsArray: [importFromPackage("Actions")], }, { - name: 'Import All Qualifiers', + name: "Import All Qualifiers", sizeLimitInKB: 40, - importsArray: [ - importFromPackage('Qualifiers') - ] - } + importsArray: [importFromPackage("Qualifiers")], + }, ]; /** * Each case is an array of strings, * Before we export, we make sure we combine them so that `importString` contains a single long string */ -export default bundleSizeTestCases.map((testCase): ITestCase => { +export default bundleSizeTestCases.map((testCase): ITestCase => { // Join all the strings into one long string, so we can write it to a file - testCase.importString = testCase.importsArray.join(''); + testCase.importString = testCase.importsArray.join(""); return testCase; }); diff --git a/__TESTS_BUNDLE_SIZE__/bundleSizeTestRunner.ts b/__TESTS_BUNDLE_SIZE__/bundleSizeTestRunner.ts index fcdb933..3b3852a 100644 --- a/__TESTS_BUNDLE_SIZE__/bundleSizeTestRunner.ts +++ b/__TESTS_BUNDLE_SIZE__/bundleSizeTestRunner.ts @@ -1,4 +1,4 @@ -import testCases from './bundleSizeTestCases'; +import testCases from "./bundleSizeTestCases"; import createEntryFile from "./utils/fileSystem/createEntryFile"; import buildWithWebpack from "./utils/webpack/buildWithWebpack"; import log from "./utils/log"; @@ -18,8 +18,8 @@ import handleTestSuccess from "./utils/testLifeCycle/handleTestSuccess"; * - Compare the file size of the bundle compared to the test limit * 3. Handle errors/success of the tests, print output */ -async function bundleSizeTestRunner():Promise { - log.info('Starting size tests, hold on!'); +async function bundleSizeTestRunner(): Promise { + log.info("Starting size tests, hold on!"); const TEST_COUNT = testCases.length; let fail_count = 0; for (let i = 0; i < testCases.length; i++) { @@ -31,19 +31,18 @@ async function bundleSizeTestRunner():Promise { const ALLOWED_MIN_SIZE_IN_KB = testCases[i].minAllowedSize || 2; // Create the entry file for Webpack - log.debug('Starting to build webpack loop'); + log.debug("Starting to build webpack loop"); createEntryFile(ENTRY_FILE, testCases[i].importString); // Build the entry file with webpack - log.debug('Webpack build - starting'); + log.debug("Webpack build - starting"); await buildWithWebpack(ENTRY_FILE, OUTPUT_FILE); - log.debug('Webpack build - finished'); + log.debug("Webpack build - finished"); // Get the bundle information const bundleInfo = getBundleInfo(OUTPUT_FILE); const ACTUAL_SIZE_IN_KB = Math.round(bundleInfo.size / 1024); - if (ACTUAL_SIZE_IN_KB <= EXPECTED_SIZE_IN_KB && ACTUAL_SIZE_IN_KB > ALLOWED_MIN_SIZE_IN_KB) { handleTestSuccess(testCases[i], ACTUAL_SIZE_IN_KB); } else { @@ -53,12 +52,10 @@ async function bundleSizeTestRunner():Promise { } if (fail_count === 0) { - log.info('Size testing done! - All OK'); + log.info("Size testing done! - All OK"); } else { throw `${fail_count}/${TEST_COUNT} Failed`; } } - - export default bundleSizeTestRunner; diff --git a/__TESTS_BUNDLE_SIZE__/interfaces/ITestCase.ts b/__TESTS_BUNDLE_SIZE__/interfaces/ITestCase.ts index f5d96d1..74fbab8 100644 --- a/__TESTS_BUNDLE_SIZE__/interfaces/ITestCase.ts +++ b/__TESTS_BUNDLE_SIZE__/interfaces/ITestCase.ts @@ -1,10 +1,10 @@ export interface ITestCase { - sizeLimitInKB: number, + sizeLimitInKB: number; // The minimum allowed size, a bundle size below this size will fail the test // Useful to ensure that something is actually imported! // Defaults internally to 2kb if field is omitted - minAllowedSize?:number, - importsArray: string[], - name: string, - importString?: string + minAllowedSize?: number; + importsArray: string[]; + name: string; + importString?: string; } diff --git a/__TESTS_BUNDLE_SIZE__/utils/consts.ts b/__TESTS_BUNDLE_SIZE__/utils/consts.ts index 153e423..9d700c7 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/consts.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/consts.ts @@ -1 +1 @@ -export const TMP_FOLDER = '.SIZE_TESTS'; +export const TMP_FOLDER = ".SIZE_TESTS"; diff --git a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createDistFolder.ts b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createDistFolder.ts index ad3eb3c..7c9b1d2 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createDistFolder.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createDistFolder.ts @@ -1,17 +1,16 @@ -import fs from 'fs'; +import fs from "fs"; import childProcess from "child_process"; import log from "../log"; /** * @description Ensures ./dist exists */ -function createDistFolder():void { +function createDistFolder(): void { // Create ./dist if needed - if (!fs.existsSync('./dist')) { - log.info('Could not find ./dist, running build'); - childProcess.execSync('npm run build'); + if (!fs.existsSync("./dist")) { + log.info("Could not find ./dist, running build"); + childProcess.execSync("npm run build"); } } - export default createDistFolder; diff --git a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createEntryFile.ts b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createEntryFile.ts index 6cea56a..cbba801 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createEntryFile.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createEntryFile.ts @@ -1,11 +1,11 @@ import fs from "fs"; import log from "../log"; -import {TMP_FOLDER} from "../consts"; +import { TMP_FOLDER } from "../consts"; /** * */ -function createEntryFile(fileName:string, str:string):void { +function createEntryFile(fileName: string, str: string): void { log.debug(`writing file ${fileName}`); fs.writeFileSync(`./${TMP_FOLDER}/entry/${fileName}.js`, str); } diff --git a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createTestFolders.ts b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createTestFolders.ts index 77ecde7..da4cc8d 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createTestFolders.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/createTestFolders.ts @@ -1,13 +1,12 @@ -import fs from 'fs'; -import {TMP_FOLDER} from "../consts"; +import fs from "fs"; +import { TMP_FOLDER } from "../consts"; /** * @description Sets up the test environment by creating the required folders */ -function createTestFolders():void { - fs.mkdirSync(`./${TMP_FOLDER}/entry`, {recursive: true}); - fs.mkdirSync(`./${TMP_FOLDER}/bundles`, {recursive: true}); +function createTestFolders(): void { + fs.mkdirSync(`./${TMP_FOLDER}/entry`, { recursive: true }); + fs.mkdirSync(`./${TMP_FOLDER}/bundles`, { recursive: true }); } - export default createTestFolders; diff --git a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/getBundleInfo.ts b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/getBundleInfo.ts index 79d0792..81eb056 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/getBundleInfo.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/getBundleInfo.ts @@ -1,5 +1,5 @@ import fs from "fs"; -import {TMP_FOLDER} from "../consts"; +import { TMP_FOLDER } from "../consts"; /** * Gets file information (like size, and blocks) given a path diff --git a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/testCleanUp.ts b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/testCleanUp.ts index 9e122ca..20ba754 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/fileSystem/testCleanUp.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/fileSystem/testCleanUp.ts @@ -1,11 +1,11 @@ import fs from "fs"; -import {TMP_FOLDER} from "../consts"; +import { TMP_FOLDER } from "../consts"; /** * Cleans up test arifacts */ -function testCleanUp():void { - fs.rmdirSync(`./${TMP_FOLDER}`, {recursive: true}); +function testCleanUp(): void { + fs.rmdirSync(`./${TMP_FOLDER}`, { recursive: true }); } export default testCleanUp; diff --git a/__TESTS_BUNDLE_SIZE__/utils/log.ts b/__TESTS_BUNDLE_SIZE__/utils/log.ts index fbe29b8..007db92 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/log.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/log.ts @@ -1,7 +1,7 @@ -const DEBUG_COLOR = '\x1b[36m%s\x1b[0m'; // cyan -const ERROR_COLOR = '\x1b[31m'; // red -const SUCCESS_COLOR = '\x1b[32m'; -const INFO_COLOR = '\x1b[37m'; +const DEBUG_COLOR = "\x1b[36m%s\x1b[0m"; // cyan +const ERROR_COLOR = "\x1b[31m"; // red +const SUCCESS_COLOR = "\x1b[32m"; +const INFO_COLOR = "\x1b[37m"; class Log { info(str: string) { diff --git a/__TESTS_BUNDLE_SIZE__/utils/stringGenerators/importFromDist.ts b/__TESTS_BUNDLE_SIZE__/utils/stringGenerators/importFromDist.ts index a00c957..6a9c839 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/stringGenerators/importFromDist.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/stringGenerators/importFromDist.ts @@ -5,7 +5,6 @@ * @returns string */ function importFromDist(pathInDist: string, namedVariableName: string): string { - return ` import {${namedVariableName}} from '${process.cwd()}/dist/${pathInDist}'; // we console log to force the bundle not to tree shake @@ -13,5 +12,4 @@ function importFromDist(pathInDist: string, namedVariableName: string): string { `; } - export default importFromDist; diff --git a/__TESTS_BUNDLE_SIZE__/utils/stringGenerators/importFromPackage.ts b/__TESTS_BUNDLE_SIZE__/utils/stringGenerators/importFromPackage.ts index 72c4b15..95d2d9f 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/stringGenerators/importFromPackage.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/stringGenerators/importFromPackage.ts @@ -5,8 +5,8 @@ * @returns string */ function importFromPackage(exportedObject: string): string { - const importString = exportedObject.includes('* as') ? exportedObject : `{${exportedObject}}`; - const variableName = exportedObject.includes('* as') ? exportedObject.split(' as ')[1] : exportedObject; + const importString = exportedObject.includes("* as") ? exportedObject : `{${exportedObject}}`; + const variableName = exportedObject.includes("* as") ? exportedObject.split(" as ")[1] : exportedObject; return ` import ${importString} from "${process.cwd()}/dist"; diff --git a/__TESTS_BUNDLE_SIZE__/utils/testLifeCycle/handleTestSuccess.ts b/__TESTS_BUNDLE_SIZE__/utils/testLifeCycle/handleTestSuccess.ts index 30046c6..8acd20b 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/testLifeCycle/handleTestSuccess.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/testLifeCycle/handleTestSuccess.ts @@ -1,11 +1,11 @@ import log from "../log"; -import {ITestCase} from "../../interfaces/ITestCase"; +import { ITestCase } from "../../interfaces/ITestCase"; /** * @param {ITestCase} testCase * @param {number} actualSizeInKB */ -function handleTestSuccess(testCase: ITestCase, actualSizeInKB: number):void { +function handleTestSuccess(testCase: ITestCase, actualSizeInKB: number): void { log.success(`${testCase.name} ${Math.round(actualSizeInKB)}KB < ${testCase.sizeLimitInKB}KB`); } diff --git a/__TESTS_BUNDLE_SIZE__/utils/webpack/buildWithWebpack.ts b/__TESTS_BUNDLE_SIZE__/utils/webpack/buildWithWebpack.ts index 8ab1a99..e435291 100644 --- a/__TESTS_BUNDLE_SIZE__/utils/webpack/buildWithWebpack.ts +++ b/__TESTS_BUNDLE_SIZE__/utils/webpack/buildWithWebpack.ts @@ -1,6 +1,5 @@ -import webpack from 'webpack'; -import {TMP_FOLDER} from "../consts"; - +import webpack from "webpack"; +import { TMP_FOLDER } from "../consts"; /** * Build a file from ./tmp/entry/{entryFile} and output the bundle to ./tmp/bundles/{outputFile} @@ -8,27 +7,31 @@ import {TMP_FOLDER} from "../consts"; * @param {string} outputFile - The name of the file to create within ./tmp/bundles/ * @returns Promise */ -function buildWithWebpack(entryFile:string, outputFile: string):Promise { +function buildWithWebpack(entryFile: string, outputFile: string): Promise { return new Promise((resolve, reject) => { - webpack({ - entry: `./${TMP_FOLDER}/entry/${entryFile}.js`, - output: { - path: process.cwd(), - filename: `./${TMP_FOLDER}/bundles/${outputFile}.js` - } - }, (err, stats) => { // Stats Object - const info = stats.toJson(); + webpack( + { + entry: `./${TMP_FOLDER}/entry/${entryFile}.js`, + output: { + path: process.cwd(), + filename: `./${TMP_FOLDER}/bundles/${outputFile}.js`, + }, + }, + (err, stats) => { + // Stats Object + const info = stats.toJson(); - if (err) { - throw err; - // Handle errors here - } + if (err) { + throw err; + // Handle errors here + } - if (stats.hasErrors()) { - throw info.errors.toString(); + if (stats.hasErrors()) { + throw info.errors.toString(); + } + resolve(); } - resolve(); - }); + ); }); } diff --git a/__TESTS__/TestUtils/createEntryMockedFS.ts b/__TESTS__/TestUtils/createEntryMockedFS.ts index 62ae64c..e522c10 100644 --- a/__TESTS__/TestUtils/createEntryMockedFS.ts +++ b/__TESTS__/TestUtils/createEntryMockedFS.ts @@ -1,12 +1,12 @@ const TEST_FILE_STRUCTURE = { - 'package.json': '{"fieldA":"foobar"}', + "package.json": '{"fieldA":"foobar"}', dist: { bundles: { umd: { - 'package.json': '{}' - } - } - } + "package.json": "{}", + }, + }, + }, }; export default TEST_FILE_STRUCTURE; diff --git a/__TESTS__/TestUtils/transformations/sampleEmptyTextStyle.ts b/__TESTS__/TestUtils/transformations/sampleEmptyTextStyle.ts index 5f0c0e5..8fb519a 100644 --- a/__TESTS__/TestUtils/transformations/sampleEmptyTextStyle.ts +++ b/__TESTS__/TestUtils/transformations/sampleEmptyTextStyle.ts @@ -1,11 +1,10 @@ -import {TextStyle} from "../../../src/qualifiers/textStyle"; +import { TextStyle } from "../../../src/qualifiers/textStyle"; /** * Creates an empty TextStyle instance used for testing */ -function sampleEmptyTextStyle(fontFamily = 'arial', fontSize = 50): TextStyle { +function sampleEmptyTextStyle(fontFamily = "arial", fontSize = 50): TextStyle { return new TextStyle(fontFamily, fontSize); } - -export {sampleEmptyTextStyle}; +export { sampleEmptyTextStyle }; diff --git a/__TESTS__/TestUtils/transformations/sampleFacePosition.ts b/__TESTS__/TestUtils/transformations/sampleFacePosition.ts index 375052f..c51fe62 100644 --- a/__TESTS__/TestUtils/transformations/sampleFacePosition.ts +++ b/__TESTS__/TestUtils/transformations/sampleFacePosition.ts @@ -1,6 +1,6 @@ -import {Position} from "../../../src/qualifiers/position"; -import {Gravity} from "../../../src/qualifiers/gravity"; -import {FocusOn} from "../../../src/qualifiers/focusOn"; +import { Position } from "../../../src/qualifiers/position"; +import { Gravity } from "../../../src/qualifiers/gravity"; +import { FocusOn } from "../../../src/qualifiers/focusOn"; /** * sample action used for testing @@ -9,4 +9,4 @@ function sampleFacePosition(): Position { return new Position().gravity(Gravity.focusOn(FocusOn.face())); } -export {sampleFacePosition}; +export { sampleFacePosition }; diff --git a/__TESTS__/TestUtils/transformations/sampleTextStyle.ts b/__TESTS__/TestUtils/transformations/sampleTextStyle.ts index f0f724f..71c9901 100644 --- a/__TESTS__/TestUtils/transformations/sampleTextStyle.ts +++ b/__TESTS__/TestUtils/transformations/sampleTextStyle.ts @@ -1,16 +1,16 @@ -import {TextStyle} from "../../../src/qualifiers/textStyle"; -import {FontAntialias} from "../../../src/qualifiers/FontAntialias"; -import {FontWeight} from "../../../src/qualifiers/fontWeight"; -import {FontHinting} from "../../../src/qualifiers/fontHinting"; -import {TextDecoration} from "../../../src/qualifiers/textDecoration"; -import {TextAlignment} from "../../../src/qualifiers/textAlignment"; -import {FontStyle} from "../../../src/qualifiers/fontStyle"; +import { TextStyle } from "../../../src/qualifiers/textStyle"; +import { FontAntialias } from "../../../src/qualifiers/FontAntialias"; +import { FontWeight } from "../../../src/qualifiers/fontWeight"; +import { FontHinting } from "../../../src/qualifiers/fontHinting"; +import { TextDecoration } from "../../../src/qualifiers/textDecoration"; +import { TextAlignment } from "../../../src/qualifiers/textAlignment"; +import { FontStyle } from "../../../src/qualifiers/fontStyle"; /** * Creates a TextStyle instance used for testing */ function sampleTextStyle(): TextStyle { - return new TextStyle('arial', 50) + return new TextStyle("arial", 50) .letterSpacing(10) .lineSpacing(20) .fontAntialias(FontAntialias.good()) @@ -19,9 +19,7 @@ function sampleTextStyle(): TextStyle { .textDecoration(TextDecoration.strikethrough()) .textAlignment(TextAlignment.justify()) .stroke() - .fontStyle(FontStyle.italic() - ); + .fontStyle(FontStyle.italic()); } - -export {sampleTextStyle}; +export { sampleTextStyle }; diff --git a/__TESTS__/TestUtils/transformations/sampleTxResizePad.ts b/__TESTS__/TestUtils/transformations/sampleTxResizePad.ts index 02f0ff9..7ee2d2c 100644 --- a/__TESTS__/TestUtils/transformations/sampleTxResizePad.ts +++ b/__TESTS__/TestUtils/transformations/sampleTxResizePad.ts @@ -1,5 +1,5 @@ -import {pad} from "../../../src/actions/resize"; -import {Transformation} from "../../../src/transformation/Transformation"; +import { pad } from "../../../src/actions/resize"; +import { Transformation } from "../../../src/transformation/Transformation"; /** * sample action used for testing @@ -8,4 +8,4 @@ function sampleTxResizePad(): Transformation { return new Transformation().resize(pad().width(100)); } -export {sampleTxResizePad}; +export { sampleTxResizePad }; diff --git a/__TESTS__/backwardsComaptibility/generateTransformationString.test.ts b/__TESTS__/backwardsComaptibility/generateTransformationString.test.ts index 8b739eb..4c381b1 100644 --- a/__TESTS__/backwardsComaptibility/generateTransformationString.test.ts +++ b/__TESTS__/backwardsComaptibility/generateTransformationString.test.ts @@ -1,16 +1,16 @@ -import {generateTransformationString} from "../../src/backwards/generateTransformationString"; +import { generateTransformationString } from "../../src/backwards/generateTransformationString"; -describe('it works?', () => { - it('omg', () => { +describe("it works?", () => { + it("omg", () => { const str = generateTransformationString({ transformation: [ { - $width: 10 + $width: 10, }, { - width: "$width + 10 + width" - } - ] + width: "$width + 10 + width", + }, + ], }); expect(str).toEqual("$width_10/w_$width_add_10_add_w"); }); @@ -18,9 +18,9 @@ describe('it works?', () => { it("should support text values", function () { const t = generateTransformationString({ effect: "$efname:100", - $efname: "!blur!" + $efname: "!blur!", }); - expect(t).toBe('$efname_!blur!,e_$efname:100'); + expect(t).toBe("$efname_!blur!,e_$efname:100"); }); it("should support string interpolation", function () { @@ -29,11 +29,13 @@ describe('it works?', () => { overlay: { text: "$(start)Hello $(name)$(ext), $(no ) $( no)$(end)", font_family: "Arial", - font_size: "18" - } + font_size: "18", + }, }); - expect(t).toBe('c_scale,l_text:Arial_18:$(start)Hello%20$(name)$(ext)%252C%20%24%28no%20%29%20%24%28%20no%29$(end)'); + expect(t).toBe( + "c_scale,l_text:Arial_18:$(start)Hello%20$(name)$(ext)%252C%20%24%28no%20%29%20%24%28%20no%29$(end)" + ); }); it("should support power operator", function () { @@ -41,9 +43,9 @@ describe('it works?', () => { transformation: [ { $small: 150, - $big: "$small ^ 1.5" - } - ] + $big: "$small ^ 1.5", + }, + ], }); expect(t).toBe("$big_$small_pow_1.5,$small_150"); }); @@ -52,37 +54,43 @@ describe('it works?', () => { const text_encoded = "Hello%20World%252C%20%252FNice%20to%20meet%20you%3F"; const t = generateTransformationString({ overlay: { - text: 'Hello World, /Nice to meet you?', + text: "Hello World, /Nice to meet you?", font_family: "Arial", font_size: "18", font_weight: "bold", font_style: "italic", letter_spacing: 4, line_spacing: 2, - font_hinting: "medium" - } + font_hinting: "medium", + }, }); expect(t).toBe(`l_text:Arial_18_bold_italic_letter_spacing_4_line_spacing_2_hinting_medium:${text_encoded}`); }); - - it('should use context value as user variables', function () { + it("should use context value as user variables", function () { const options = { - variables: [["$xpos", "ctx:!x_pos!_to_f"], ["$ypos", "ctx:!y_pos!_to_f"]], + variables: [ + ["$xpos", "ctx:!x_pos!_to_f"], + ["$ypos", "ctx:!y_pos!_to_f"], + ], crop: "crop", x: "$xpos * w", - y: "$ypos * h" + y: "$ypos * h", }; - expect(generateTransformationString(options)) - .toContain('$xpos_ctx:!x_pos!_to_f,$ypos_ctx:!y_pos!_to_f,c_crop,x_$xpos_mul_w,y_$ypos_mul_h'); + expect(generateTransformationString(options)).toContain( + "$xpos_ctx:!x_pos!_to_f,$ypos_ctx:!y_pos!_to_f,c_crop,x_$xpos_mul_w,y_$ypos_mul_h" + ); }); it("array should define a set of variables", function () { const options = { if: "face_count > 2", - variables: [["$z", 5], ["$foo", "$z * 2"]], + variables: [ + ["$z", 5], + ["$foo", "$z * 2"], + ], crop: "scale", - width: "$foo * 200" + width: "$foo * 200", }; const t = generateTransformationString(options); expect(t).toEqual("if_fc_gt_2,$z_5,$foo_$z_mul_2,c_scale,w_$foo_mul_200"); @@ -91,19 +99,19 @@ describe('it works?', () => { const options = { transformation: [ { - $foo: 10 + $foo: 10, }, { - if: "face_count > 2" + if: "face_count > 2", }, { crop: "scale", - width: "$foo * 200 / face_count" + width: "$foo * 200 / face_count", }, { - if: "end" - } - ] + if: "end", + }, + ], }; const t = generateTransformationString(options); expect(t).toEqual("$foo_10/if_fc_gt_2/c_scale,w_$foo_mul_200_div_fc/if_end"); @@ -112,12 +120,12 @@ describe('it works?', () => { const options = { transformation: [ { - $width: 10 + $width: 10, }, { - width: "$width + 10 + width" - } - ] + width: "$width + 10 + width", + }, + ], }; const t = generateTransformationString(options); expect(t).toEqual("$width_10/w_$width_add_10_add_w"); @@ -128,9 +136,9 @@ describe('it works?', () => { transformation: [ { $small: 150, - $big: "$small ^ 1.5" - } - ] + $big: "$small ^ 1.5", + }, + ], }; const t = generateTransformationString(options); expect(t).toEqual("$big_$small_pow_1.5,$small_150"); @@ -140,16 +148,16 @@ describe('it works?', () => { const optionsAsObject = { transformation: [ { - border: { width: 4, color: 'white' } - } - ] + border: { width: 4, color: "white" }, + }, + ], }; const optionsAsString = { transformation: [ { - border: '4px_solid_white' - } - ] + border: "4px_solid_white", + }, + ], }; const tObj = generateTransformationString(optionsAsObject); const tStr = generateTransformationString(optionsAsString); @@ -161,9 +169,9 @@ describe('it works?', () => { const options = { transformation: [ { - radius: [10, 20, 30, 40] - } - ] + radius: [10, 20, 30, 40], + }, + ], }; const t = generateTransformationString(options); expect(t).toEqual("r_10:20:30:40"); @@ -173,12 +181,11 @@ describe('it works?', () => { const options = { transformation: [ { - radius: 'max' - } - ] + radius: "max", + }, + ], }; const t = generateTransformationString(options); expect(t).toEqual("r_max"); }); - }); diff --git a/__TESTS__/backwardsComaptibility/transformationLegacyTests/legacyExpression.test.ts b/__TESTS__/backwardsComaptibility/transformationLegacyTests/legacyExpression.test.ts index 0f353aa..128ac25 100644 --- a/__TESTS__/backwardsComaptibility/transformationLegacyTests/legacyExpression.test.ts +++ b/__TESTS__/backwardsComaptibility/transformationLegacyTests/legacyExpression.test.ts @@ -1,41 +1,38 @@ -import {stringOrNumber} from "../../../src/types/types"; -import {legacyNormalizeExpression} from "../../../src/backwards/utils/legacyNormalizeExpression"; +import { stringOrNumber } from "../../../src/types/types"; +import { legacyNormalizeExpression } from "../../../src/backwards/utils/legacyNormalizeExpression"; describe("Legacy Expression normalization", function () { const cases: Record = { - 'null is not affected': [null, null], - 'number replaced with a string value': [10, '10'], - 'empty string is not affected': ['', ''], - 'single space is replaced with a single underscore': [' ', '_'], - 'blank string is replaced with a single underscore': [' ', '_'], - 'underscore is not affected': ['_', '_'], - 'sequence of underscores and spaces is replaced with a single underscore': [' _ __ _', '_'], - 'arbitrary text is not affected': ['foobar', 'foobar'], - 'double ampersand replaced with and operator': ['foo && bar', 'foo_and_bar'], - 'double ampersand with no space at the end is not affected': ['foo&&bar', 'foo&&bar'], - 'width recognized as variable and replaced with w': ['width', 'w'], - 'initial aspect ratio recognized as variable and replaced with iar': ['initial_aspect_ratio', 'iar'], - '$width recognized as user variable and not affected': ['$width', '$width'], - '$initial_aspect_ratio recognized as user variable followed by aspect_ratio variable': [ - '$initial_aspect_ratio', - '$initial_ar' + "null is not affected": [null, null], + "number replaced with a string value": [10, "10"], + "empty string is not affected": ["", ""], + "single space is replaced with a single underscore": [" ", "_"], + "blank string is replaced with a single underscore": [" ", "_"], + "underscore is not affected": ["_", "_"], + "sequence of underscores and spaces is replaced with a single underscore": [" _ __ _", "_"], + "arbitrary text is not affected": ["foobar", "foobar"], + "double ampersand replaced with and operator": ["foo && bar", "foo_and_bar"], + "double ampersand with no space at the end is not affected": ["foo&&bar", "foo&&bar"], + "width recognized as variable and replaced with w": ["width", "w"], + "initial aspect ratio recognized as variable and replaced with iar": ["initial_aspect_ratio", "iar"], + "$width recognized as user variable and not affected": ["$width", "$width"], + "$initial_aspect_ratio recognized as user variable followed by aspect_ratio variable": [ + "$initial_aspect_ratio", + "$initial_ar", ], - '$mywidth recognized as user variable and not affected': ['$mywidth', '$mywidth'], - '$widthwidth recognized as user variable and not affected': ['$widthwidth', '$widthwidth'], - '$_width recognized as user variable and not affected': ['$_width', '$_width'], - '$__width recognized as user variable and not affected': ['$__width', '$_width'], - '$$width recognized as user variable and not affected': ['$$width', '$$width'], - '$height recognized as user variable and not affected': ['$height_100', '$height_100'], - '$heightt_100 recognized as user variable and not affected': ['$heightt_100', '$heightt_100'], - '$$height_100 recognized as user variable and not affected': ['$$height_100', '$$height_100'], - '$heightmy_100 recognized as user variable and not affected': ['$heightmy_100', '$heightmy_100'], - '$myheight_100 recognized as user variable and not affected': ['$myheight_100', '$myheight_100'], - '$heightheight_100 recognized as user variable and not affected': [ - '$heightheight_100', - '$heightheight_100' - ], - '$theheight_100 recognized as user variable and not affected': ['$theheight_100', '$theheight_100'], - '$__height_100 recognized as user variable and not affected': ['$__height_100', '$_height_100'] + "$mywidth recognized as user variable and not affected": ["$mywidth", "$mywidth"], + "$widthwidth recognized as user variable and not affected": ["$widthwidth", "$widthwidth"], + "$_width recognized as user variable and not affected": ["$_width", "$_width"], + "$__width recognized as user variable and not affected": ["$__width", "$_width"], + "$$width recognized as user variable and not affected": ["$$width", "$$width"], + "$height recognized as user variable and not affected": ["$height_100", "$height_100"], + "$heightt_100 recognized as user variable and not affected": ["$heightt_100", "$heightt_100"], + "$$height_100 recognized as user variable and not affected": ["$$height_100", "$$height_100"], + "$heightmy_100 recognized as user variable and not affected": ["$heightmy_100", "$heightmy_100"], + "$myheight_100 recognized as user variable and not affected": ["$myheight_100", "$myheight_100"], + "$heightheight_100 recognized as user variable and not affected": ["$heightheight_100", "$heightheight_100"], + "$theheight_100 recognized as user variable and not affected": ["$theheight_100", "$theheight_100"], + "$__height_100 recognized as user variable and not affected": ["$__height_100", "$_height_100"], }; Object.keys(cases).forEach(function (testDescription) { diff --git a/__TESTS__/unit/Action/Action.test.ts b/__TESTS__/unit/Action/Action.test.ts index ce1a5de..69c7fde 100644 --- a/__TESTS__/unit/Action/Action.test.ts +++ b/__TESTS__/unit/Action/Action.test.ts @@ -1,100 +1,80 @@ -import {Action} from '../../../src/internal/Action'; -import {Qualifier} from '../../../src/internal/qualifier/Qualifier'; -import {QualifierValue} from "../../../src/internal/qualifier/QualifierValue"; -import {FlagQualifier} from "../../../src/qualifiers/flag/FlagQualifier"; -import {Transformation} from "../../../src"; - - -describe('Tests for Transformation Action', () => { - it('Creates a transformation with new action while passing a qualifier to addQualifier()', () => { - const action = new Action().addQualifier(new Qualifier('a', 90)); - const tx = new Transformation() - .addAction(action) - .toString(); - - expect(tx).toBe('a_90'); +import { Action } from "../../../src/internal/Action"; +import { Qualifier } from "../../../src/internal/qualifier/Qualifier"; +import { QualifierValue } from "../../../src/internal/qualifier/QualifierValue"; +import { FlagQualifier } from "../../../src/qualifiers/flag/FlagQualifier"; +import { Transformation } from "../../../src"; + +describe("Tests for Transformation Action", () => { + it("Creates a transformation with new action while passing a qualifier to addQualifier()", () => { + const action = new Action().addQualifier(new Qualifier("a", 90)); + const tx = new Transformation().addAction(action).toString(); + + expect(tx).toBe("a_90"); }); - it('Creates a transformation with new action while passing an array to addQualifier()', () => { - const action = new Action().addQualifier(new Qualifier('a', new QualifierValue([90, 80]).setDelimiter('.'))); + it("Creates a transformation with new action while passing an array to addQualifier()", () => { + const action = new Action().addQualifier(new Qualifier("a", new QualifierValue([90, 80]).setDelimiter("."))); - const tx = new Transformation() - .addAction(action) - .toString(); + const tx = new Transformation().addAction(action).toString(); - expect(tx).toBe('a_90.80'); + expect(tx).toBe("a_90.80"); }); - it('Creates a transformation with new action using addValue()', () => { - const action = new Action().addQualifier(new Qualifier('a', new QualifierValue([90, 80]).setDelimiter('.')).addValue(70)); + it("Creates a transformation with new action using addValue()", () => { + const action = new Action().addQualifier( + new Qualifier("a", new QualifierValue([90, 80]).setDelimiter(".")).addValue(70) + ); - const tx = new Transformation() - .addAction(action) - .toString(); + const tx = new Transformation().addAction(action).toString(); - expect(tx).toBe('a_90.80.70'); + expect(tx).toBe("a_90.80.70"); }); - it('Creates a transformation with new action while calling addQualifier twice', () => { - const action = new Action() - .addQualifier(new Qualifier('w', 100)) - .addQualifier(new Qualifier('c', 'fill')); + it("Creates a transformation with new action while calling addQualifier twice", () => { + const action = new Action().addQualifier(new Qualifier("w", 100)).addQualifier(new Qualifier("c", "fill")); - const tx = new Transformation() - .addAction(action) - .toString(); + const tx = new Transformation().addAction(action).toString(); - expect(tx).toBe('c_fill,w_100'); + expect(tx).toBe("c_fill,w_100"); }); - it('Creates a transformation with new action, overwriting existing qualifier', () => { - const action = new Action() - .addQualifier(new Qualifier('w', 100)) - .addQualifier(new Qualifier('w', 200)); + it("Creates a transformation with new action, overwriting existing qualifier", () => { + const action = new Action().addQualifier(new Qualifier("w", 100)).addQualifier(new Qualifier("w", 200)); - const tx = new Transformation() - .addAction(action) - .toString(); + const tx = new Transformation().addAction(action).toString(); - expect(tx).toBe('w_200'); + expect(tx).toBe("w_200"); }); - it('Creates a transformation with new action while adding a single flag', () => { - const action = new Action() - .addQualifier(new Qualifier('l', 'sample')) - .addFlag(new FlagQualifier('layer_apply')); + it("Creates a transformation with new action while adding a single flag", () => { + const action = new Action().addQualifier(new Qualifier("l", "sample")).addFlag(new FlagQualifier("layer_apply")); - const tx = new Transformation() - .addAction(action) - .toString(); + const tx = new Transformation().addAction(action).toString(); - expect(tx).toBe('fl_layer_apply,l_sample'); + expect(tx).toBe("fl_layer_apply,l_sample"); }); - it('Creates a transformation with new action while adding multiple flags', () => { + it("Creates a transformation with new action while adding multiple flags", () => { const action = new Action() - .addQualifier(new Qualifier('l', 'sample')) - .addFlag(new FlagQualifier('first_flag')) - .addFlag(new FlagQualifier('second_flag')); + .addQualifier(new Qualifier("l", "sample")) + .addFlag(new FlagQualifier("first_flag")) + .addFlag(new FlagQualifier("second_flag")); - const tx = new Transformation() - .addAction(action) - .toString(); + const tx = new Transformation().addAction(action).toString(); - expect(tx).toBe('fl_first_flag,fl_second_flag,l_sample'); + expect(tx).toBe("fl_first_flag,fl_second_flag,l_sample"); }); - it('Correctly sorts qualifiers', () => { + it("Correctly sorts qualifiers", () => { const action = new Action() - .addQualifier(new Qualifier('b', '2')) - .addFlag(new FlagQualifier('a')) - .addQualifier(new Qualifier('a', '1')) - .addFlag(new FlagQualifier('b')) - .addQualifier(new Qualifier('c', '3')); + .addQualifier(new Qualifier("b", "2")) + .addFlag(new FlagQualifier("a")) + .addQualifier(new Qualifier("a", "1")) + .addFlag(new FlagQualifier("b")) + .addQualifier(new Qualifier("c", "3")); - expect(action.toString()).toBe('a_1,b_2,c_3,fl_a,fl_b'); + expect(action.toString()).toBe("a_1,b_2,c_3,fl_a,fl_b"); }); - it('Add and read actions tags', () => { - const action = new Action() - .setActionTag('testing'); + it("Add and read actions tags", () => { + const action = new Action().setActionTag("testing"); - expect(action.getActionTag()).toBe('testing'); + expect(action.getActionTag()).toBe("testing"); }); }); diff --git a/__TESTS__/unit/Action/Flag.test.ts b/__TESTS__/unit/Action/Flag.test.ts index 0aae248..cbad9ab 100644 --- a/__TESTS__/unit/Action/Flag.test.ts +++ b/__TESTS__/unit/Action/Flag.test.ts @@ -1,15 +1,15 @@ -import {FlagQualifier} from "../../../src/qualifiers/flag/FlagQualifier"; -import {Action} from "../../../src/internal/Action"; +import { FlagQualifier } from "../../../src/qualifiers/flag/FlagQualifier"; +import { Action } from "../../../src/internal/Action"; -describe('Tests for Flag', () => { - it('Creates a Flag', () => { +describe("Tests for Flag", () => { + it("Creates a Flag", () => { const flag = new FlagQualifier("single_flag"); - expect(flag.toString()).toBe('fl_single_flag'); + expect(flag.toString()).toBe("fl_single_flag"); }); - it ('Creates an action with multiple flags', () => { - const str = new Action().addFlag('foo').addFlag('bar').toString(); + it("Creates an action with multiple flags", () => { + const str = new Action().addFlag("foo").addFlag("bar").toString(); - expect(str).toEqual('fl_bar,fl_foo'); + expect(str).toEqual("fl_bar,fl_foo"); }); }); diff --git a/__TESTS__/unit/Action/Qualifier.ts b/__TESTS__/unit/Action/Qualifier.ts index 9052535..fcbb11c 100644 --- a/__TESTS__/unit/Action/Qualifier.ts +++ b/__TESTS__/unit/Action/Qualifier.ts @@ -1,19 +1,19 @@ -import {Qualifier} from '../../../src/internal/qualifier/Qualifier'; -import {QualifierValue} from '../../../src/internal/qualifier/QualifierValue'; +import { Qualifier } from "../../../src/internal/qualifier/Qualifier"; +import { QualifierValue } from "../../../src/internal/qualifier/QualifierValue"; -describe('Tests for Qualifier', () => { - it('Creates a Qualifier', () => { +describe("Tests for Qualifier", () => { + it("Creates a Qualifier", () => { const qualifier = new Qualifier("a", 90); - expect(qualifier.toString()).toBe('a_90'); + expect(qualifier.toString()).toBe("a_90"); }); - it('Creates a Qualifier with multiple values', () => { - const qualifier = new Qualifier("a", new QualifierValue([90, 80]).setDelimiter('.')); + it("Creates a Qualifier with multiple values", () => { + const qualifier = new Qualifier("a", new QualifierValue([90, 80]).setDelimiter(".")); - expect(qualifier.toString()).toBe('a_90.80'); + expect(qualifier.toString()).toBe("a_90.80"); }); - it('Creates a Qualifier, passing QualifierValue to constructor', () => { + it("Creates a Qualifier, passing QualifierValue to constructor", () => { const qualifier = new Qualifier("a", new QualifierValue(90)); - expect(qualifier.toString()).toBe('a_90'); + expect(qualifier.toString()).toBe("a_90"); }); }); diff --git a/__TESTS__/unit/Action/QualifierValue.test.ts b/__TESTS__/unit/Action/QualifierValue.test.ts index 8b9a54f..f01570a 100644 --- a/__TESTS__/unit/Action/QualifierValue.test.ts +++ b/__TESTS__/unit/Action/QualifierValue.test.ts @@ -1,19 +1,18 @@ -import {QualifierValue} from '../../../src/internal/qualifier/QualifierValue'; +import { QualifierValue } from "../../../src/internal/qualifier/QualifierValue"; -describe('Tests for Qualifier', () => { - it('Creates a QualifierValue', () => { +describe("Tests for Qualifier", () => { + it("Creates a QualifierValue", () => { const qualifierValue = new QualifierValue(); - expect(qualifierValue.toString()).toBe(''); + expect(qualifierValue.toString()).toBe(""); }); - it('Creates a QualifierValue with single value', () => { + it("Creates a QualifierValue with single value", () => { const qualifierValue = new QualifierValue().addValue(90); - expect(qualifierValue.toString()).toBe('90'); + expect(qualifierValue.toString()).toBe("90"); }); - it('Creates a QualifierValue with multiple values', () => { + it("Creates a QualifierValue with multiple values", () => { const qualifierValue = new QualifierValue().addValue(90).addValue(80); - expect(qualifierValue.toString()).toBe('90:80'); + expect(qualifierValue.toString()).toBe("90:80"); }); - }); diff --git a/__TESTS__/unit/actions/Adjust.test.ts b/__TESTS__/unit/actions/Adjust.test.ts index 923fde3..66ffcea 100644 --- a/__TESTS__/unit/actions/Adjust.test.ts +++ b/__TESTS__/unit/actions/Adjust.test.ts @@ -1,10 +1,9 @@ -import {Adjust} from "../../../src/actions/adjust"; -import {ImproveMode} from "../../../src/qualifiers/improveMode"; -import {Transformation} from "../../../src"; +import { Adjust } from "../../../src/actions/adjust"; +import { ImproveMode } from "../../../src/qualifiers/improveMode"; +import { Transformation } from "../../../src"; - -describe('Tests for Transformation Action -- Adjust', () => { - it('Ensure leveledAdjusts work properly', () => { +describe("Tests for Transformation Action -- Adjust", () => { + it("Ensure leveledAdjusts work properly", () => { const tx = new Transformation() .adjust(Adjust.autoBrightness()) .adjust(Adjust.autoBrightness().blend(50)) @@ -58,152 +57,128 @@ describe('Tests for Transformation Action -- Adjust', () => { .toString(); const expectedToContain = [ - 'e_auto_brightness', - 'e_auto_brightness:50', - 'e_auto_brightness:100', - 'e_auto_color', - 'e_auto_color:50', - 'e_auto_color:100', - 'e_auto_contrast', - 'e_auto_contrast:50', - 'e_auto_contrast:100', - 'e_red', - 'e_red:50', - 'e_red:100', - 'e_green', - 'e_green:50', - 'e_green:100', - 'e_blue', - 'e_blue:50', - 'e_blue:100', - 'e_brightness', - 'e_brightness:50', - 'e_brightness:100', - 'e_brightness_hsb', - 'e_brightness_hsb:50', - 'e_brightness_hsb:100', - 'e_contrast', - 'e_contrast:50', - 'e_contrast:100', - 'e_gamma', - 'e_gamma:50', - 'e_gamma:100', - 'e_hue', - 'e_hue:50', - 'e_hue:100', - 'e_opacity_threshold', - 'e_opacity_threshold:50', - 'e_opacity_threshold:100', - 'e_saturation', - 'e_saturation:50', - 'e_saturation:100', - 'e_sharpen', - 'e_sharpen:50', - 'e_sharpen:100', - 'e_unsharp_mask', - 'e_unsharp_mask:50', - 'e_unsharp_mask:100', - 'e_vibrance:100', - 'e_vibrance:100', - 'o_100' - ].join('/'); + "e_auto_brightness", + "e_auto_brightness:50", + "e_auto_brightness:100", + "e_auto_color", + "e_auto_color:50", + "e_auto_color:100", + "e_auto_contrast", + "e_auto_contrast:50", + "e_auto_contrast:100", + "e_red", + "e_red:50", + "e_red:100", + "e_green", + "e_green:50", + "e_green:100", + "e_blue", + "e_blue:50", + "e_blue:100", + "e_brightness", + "e_brightness:50", + "e_brightness:100", + "e_brightness_hsb", + "e_brightness_hsb:50", + "e_brightness_hsb:100", + "e_contrast", + "e_contrast:50", + "e_contrast:100", + "e_gamma", + "e_gamma:50", + "e_gamma:100", + "e_hue", + "e_hue:50", + "e_hue:100", + "e_opacity_threshold", + "e_opacity_threshold:50", + "e_opacity_threshold:100", + "e_saturation", + "e_saturation:50", + "e_saturation:100", + "e_sharpen", + "e_sharpen:50", + "e_sharpen:100", + "e_unsharp_mask", + "e_unsharp_mask:50", + "e_unsharp_mask:100", + "e_vibrance:100", + "e_vibrance:100", + "o_100", + ].join("/"); expect(tx).toBe(`${expectedToContain}`); }); - it('tests replaceColor', () => { - const tx = new Transformation() - .adjust(Adjust - .replaceColor('red') - .tolerance(30) - .fromColor('blue')) - .toString(); + it("tests replaceColor", () => { + const tx = new Transformation().adjust(Adjust.replaceColor("red").tolerance(30).fromColor("blue")).toString(); - expect(tx).toContain('e_replace_color:red:30:blue'); + expect(tx).toContain("e_replace_color:red:30:blue"); }); - it('tests replaceColor with RGB colors', () => { - const tx = new Transformation() - .adjust(Adjust - .replaceColor('#fff') - .tolerance(30) - .fromColor('#aaa')) - .toString(); + it("tests replaceColor with RGB colors", () => { + const tx = new Transformation().adjust(Adjust.replaceColor("#fff").tolerance(30).fromColor("#aaa")).toString(); - expect(tx).toContain('e_replace_color:fff:30:aaa'); + expect(tx).toContain("e_replace_color:fff:30:aaa"); }); - it('tests replaceColor - without fromColor', () => { - const tx = new Transformation() - .adjust(Adjust.replaceColor('red')) - .toString(); + it("tests replaceColor - without fromColor", () => { + const tx = new Transformation().adjust(Adjust.replaceColor("red")).toString(); - expect(tx).toContain('e_replace_color:red'); + expect(tx).toContain("e_replace_color:red"); }); - it('tests recolor matrix', () => { + it("tests recolor matrix", () => { const tx = new Transformation() - .adjust(Adjust.recolor([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]])) + .adjust( + Adjust.recolor([ + [0.1, 0.2, 0.3], + [0.4, 0.5, 0.6], + [0.7, 0.8, 0.9], + ]) + ) .toString(); - expect(tx).toContain('e_recolor:0.1:0.2:0.3:0.4:0.5:0.6:0.7:0.8:0.9'); + expect(tx).toContain("e_recolor:0.1:0.2:0.3:0.4:0.5:0.6:0.7:0.8:0.9"); }); - it('tests fillLight', () => { - const tx = new Transformation() - .adjust(Adjust.fillLight().blend(0).bias(0)) - .toString(); + it("tests fillLight", () => { + const tx = new Transformation().adjust(Adjust.fillLight().blend(0).bias(0)).toString(); - expect(tx).toContain('e_fill_light:0:0'); + expect(tx).toContain("e_fill_light:0:0"); }); - it('tests improve', () => { - const tx = new Transformation() - .adjust(Adjust.improve().mode(ImproveMode.outdoor()).blend(0)) - .toString(); + it("tests improve", () => { + const tx = new Transformation().adjust(Adjust.improve().mode(ImproveMode.outdoor()).blend(0)).toString(); - expect(tx).toContain('e_improve:outdoor:0'); + expect(tx).toContain("e_improve:outdoor:0"); }); - it('can use shortened improve notation', () => { - const tx = new Transformation() - .adjust(Adjust.improve().mode("outdoor").blend(0)) - .toString(); + it("can use shortened improve notation", () => { + const tx = new Transformation().adjust(Adjust.improve().mode("outdoor").blend(0)).toString(); - expect(tx).toContain('e_improve:outdoor:0'); + expect(tx).toContain("e_improve:outdoor:0"); }); - it('tests by3dLut', () => { - expect(Adjust - .by3dLut('sample') - .toString() - ).toBe('l_lut:sample/fl_layer_apply'); + it("tests by3dLut", () => { + expect(Adjust.by3dLut("sample").toString()).toBe("l_lut:sample/fl_layer_apply"); }); - it('tests viesuscorrect', () => { - expect(Adjust.viesusCorrect() - .toString()).toBe('e_viesus_correct'); + it("tests viesuscorrect", () => { + expect(Adjust.viesusCorrect().toString()).toBe("e_viesus_correct"); - expect(Adjust.viesusCorrect() - .noRedEye() - .toString()).toBe('e_viesus_correct:no_redeye'); + expect(Adjust.viesusCorrect().noRedEye().toString()).toBe("e_viesus_correct:no_redeye"); - expect(Adjust.viesusCorrect() - .skinSaturation() - .toString()).toBe('e_viesus_correct:skin_saturation'); + expect(Adjust.viesusCorrect().skinSaturation().toString()).toBe("e_viesus_correct:skin_saturation"); - expect(Adjust.viesusCorrect() - .skinSaturation(10) - .toString()).toBe('e_viesus_correct:skin_saturation_10'); + expect(Adjust.viesusCorrect().skinSaturation(10).toString()).toBe("e_viesus_correct:skin_saturation_10"); }); - - it('Tests for Adjust.tint', () => { - let tintVal = 'equalize:80:red:50p:blue:60p:yellow:40p'; + it("Tests for Adjust.tint", () => { + let tintVal = "equalize:80:red:50p:blue:60p:yellow:40p"; expect(Adjust.tint(tintVal).toString()).toBe(`e_tint:${tintVal}`); - tintVal = 'Anything here is just added as a raw string:to the action, with special characters/no validation'; + tintVal = "Anything here is just added as a raw string:to the action, with special characters/no validation"; expect(Adjust.tint(tintVal).toString()).toBe(`e_tint:${tintVal}`); }); - }); diff --git a/__TESTS__/unit/actions/Animated.test.ts b/__TESTS__/unit/actions/Animated.test.ts index 9a6111b..2f3ed65 100644 --- a/__TESTS__/unit/actions/Animated.test.ts +++ b/__TESTS__/unit/actions/Animated.test.ts @@ -1,12 +1,10 @@ -import {Animated} from "../../../src/actions/animated"; -import {Transformation} from "../../../src"; +import { Animated } from "../../../src/actions/animated"; +import { Transformation } from "../../../src"; -describe('Tests for Transformation Action -- Animated', () => { - it('Creates a Transformation with animated', () => { - const tx = new Transformation() - .animated(Animated.edit().delay(200).loop(3)) - .toString(); +describe("Tests for Transformation Action -- Animated", () => { + it("Creates a Transformation with animated", () => { + const tx = new Transformation().animated(Animated.edit().delay(200).loop(3)).toString(); - expect(tx).toBe('dl_200,e_loop:3'); + expect(tx).toBe("dl_200,e_loop:3"); }); }); diff --git a/__TESTS__/unit/actions/Background.test.ts b/__TESTS__/unit/actions/Background.test.ts index 06fdef6..ed07218 100644 --- a/__TESTS__/unit/actions/Background.test.ts +++ b/__TESTS__/unit/actions/Background.test.ts @@ -1,4 +1,4 @@ -import {Color} from "../../../src/qualifiers/color"; +import { Color } from "../../../src/qualifiers/color"; import * as Resize from "../../../src/actions/resize"; import { auto, @@ -7,168 +7,130 @@ import { borderGradient, predominant, predominantGradient, - blurred + blurred, } from "../../../src/qualifiers/background"; -import {GradientDirection} from "../../../src/qualifiers/gradientDirection"; -import {Transformation} from "../../../src"; +import { GradientDirection } from "../../../src/qualifiers/gradientDirection"; +import { Transformation } from "../../../src"; +describe("Tests for Transformation Action -- Background", () => { + it("Creates a Transformation with Background.auto", () => { + const tx = new Transformation().backgroundColor(Color.RED).toString(); -describe('Tests for Transformation Action -- Background', () => { - it('Creates a Transformation with Background.auto', () => { - const tx = new Transformation() - .backgroundColor(Color.RED) - .toString(); - - expect(tx).toBe('b_red'); + expect(tx).toBe("b_red"); }); - - it('Background.border().contrast()', () => { + it("Background.border().contrast()", () => { const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(border().contrast()) - ) - .resize(Resize.pad(250, 250) - .background(border()) - ) + .resize(Resize.pad(250, 250).background(border().contrast())) + .resize(Resize.pad(250, 250).background(border())) .toString(); - expect(tx).toContain('b_auto:border_contrast,c_pad,h_250,w_250/b_auto:border,c_pad,h_250,w_250'); + expect(tx).toContain("b_auto:border_contrast,c_pad,h_250,w_250/b_auto:border,c_pad,h_250,w_250"); }); - it('Background.border().contrast().palette()', () => { + it("Background.border().contrast().palette()", () => { const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(border().contrast().palette('red', 'green', 'blue')) - ) + .resize(Resize.pad(250, 250).background(border().contrast().palette("red", "green", "blue"))) .toString(); - expect(tx).toContain('b_auto:border_contrast:palette_red_green_blue,c_pad,h_250,w_250'); + expect(tx).toContain("b_auto:border_contrast:palette_red_green_blue,c_pad,h_250,w_250"); }); + it("Background.auto()", () => { + const tx = new Transformation().resize(Resize.pad(250, 250).background(auto())).toString(); - it('Background.auto()', () => { - const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(auto()) - ) - .toString(); - - expect(tx).toContain('b_auto,c_pad,h_250,w_250'); + expect(tx).toContain("b_auto,c_pad,h_250,w_250"); }); - it('Background.borderGradient().gradientDirection().gradientColors()', () => { + it("Background.borderGradient().gradientDirection().gradientColors()", () => { const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(borderGradient() - .gradientDirection(GradientDirection.horizontal()) - .gradientColors(2) - .contrast() - .palette('red', 'green', 'blue') - ) - ) - .resize(Resize.pad(250, 250) - .background(borderGradient() + .resize( + Resize.pad(250, 250).background( + borderGradient() + .gradientDirection(GradientDirection.horizontal()) + .gradientColors(2) + .contrast() + .palette("red", "green", "blue") ) ) + .resize(Resize.pad(250, 250).background(borderGradient())) .toString(); - expect(tx).toContain('b_auto:border_gradient_contrast:2:horizontal:palette_red_green_blue,c_pad,h_250,w_250/b_auto:border_gradient,c_pad,h_250,w_250'); + expect(tx).toContain( + "b_auto:border_gradient_contrast:2:horizontal:palette_red_green_blue,c_pad,h_250,w_250/b_auto:border_gradient,c_pad,h_250,w_250" + ); }); - it('can use shortened GradientDirection notation', () => { + it("can use shortened GradientDirection notation", () => { const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(borderGradient() - .gradientDirection("horizontal") - ) - ) + .resize(Resize.pad(250, 250).background(borderGradient().gradientDirection("horizontal"))) .toString(); - expect(tx).toContain('b_auto:border_gradient:horizontal,c_pad,h_250,w_250'); + expect(tx).toContain("b_auto:border_gradient:horizontal,c_pad,h_250,w_250"); }); - it('Background.predominantGradient().gradientDirection().gradientColors()', () => { + it("Background.predominantGradient().gradientDirection().gradientColors()", () => { const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(predominantGradient() - .gradientDirection(GradientDirection.horizontal()) - .gradientColors(2) - .contrast() - .palette('red', 'green', 'blue') + .resize( + Resize.pad(250, 250).background( + predominantGradient() + .gradientDirection(GradientDirection.horizontal()) + .gradientColors(2) + .contrast() + .palette("red", "green", "blue") ) ) - .resize(Resize.pad(250, 250) - .background(predominantGradient()) - ) + .resize(Resize.pad(250, 250).background(predominantGradient())) .toString(); - expect(tx).toContain('b_auto:predominant_gradient_contrast:2:horizontal:palette_red_green_blue,c_pad,h_250,w_250/b_auto:predominant_gradient,c_pad,h_250,w_250'); + expect(tx).toContain( + "b_auto:predominant_gradient_contrast:2:horizontal:palette_red_green_blue,c_pad,h_250,w_250/b_auto:predominant_gradient,c_pad,h_250,w_250" + ); }); + it("Background.Color()", () => { + const tx = new Transformation().resize(Resize.pad(250, 250).background(color("red"))).toString(); - it('Background.Color()', () => { - const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(color('red')) - ) - .toString(); - - expect(tx).toBe('b_red,c_pad,h_250,w_250'); + expect(tx).toBe("b_red,c_pad,h_250,w_250"); }); - it('Background.predominant().contrast().palette()', () => { + it("Background.predominant().contrast().palette()", () => { const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(predominant().contrast().palette('red', 'green', 'blue')) - ) - .resize(Resize.pad(250, 250) - .background(predominant()) - ) + .resize(Resize.pad(250, 250).background(predominant().contrast().palette("red", "green", "blue"))) + .resize(Resize.pad(250, 250).background(predominant())) .toString(); - expect(tx).toContain('b_auto:predominant_contrast:palette_red_green_blue,c_pad,h_250,w_250/b_auto:predominant,c_pad,h_250,w_250'); + expect(tx).toContain( + "b_auto:predominant_contrast:palette_red_green_blue,c_pad,h_250,w_250/b_auto:predominant,c_pad,h_250,w_250" + ); }); + it("Test blurred background", () => { + const tx = new Transformation().resize(Resize.pad(250, 250).background(blurred())).toString(); - it('Test blurred background', () => { - const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(blurred()) - ) - .toString(); - - expect(tx).toContain('b_blurred'); + expect(tx).toContain("b_blurred"); }); - it('Test blurred background with one qualifiers', () => { + it("Test blurred background with one qualifiers", () => { const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background(blurred().intensity(100).brightness(100)) - ) + .resize(Resize.pad(250, 250).background(blurred().intensity(100).brightness(100))) .toString(); - expect(tx).toContain('b_blurred:100:100'); + expect(tx).toContain("b_blurred:100:100"); }); - describe('Test generative fill background', () => { - it('without prompt', () => { - const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background("gen_fill") - ) - .toString(); + describe("Test generative fill background", () => { + it("without prompt", () => { + const tx = new Transformation().resize(Resize.pad(250, 250).background("gen_fill")).toString(); - expect(tx).toContain('b_gen_fill'); + expect(tx).toContain("b_gen_fill"); }); - it('with prompt', () => { + it("with prompt", () => { const tx = new Transformation() - .resize(Resize.pad(250, 250) - .background("gen_fill:prompt_turtles in the sea") - ) + .resize(Resize.pad(250, 250).background("gen_fill:prompt_turtles in the sea")) .toString(); - expect(tx).toContain('b_gen_fill:prompt_turtles in the sea'); + expect(tx).toContain("b_gen_fill:prompt_turtles in the sea"); }); }); }); diff --git a/__TESTS__/unit/actions/Blur/Blur.test.ts b/__TESTS__/unit/actions/Blur/Blur.test.ts index 8869471..9e21846 100644 --- a/__TESTS__/unit/actions/Blur/Blur.test.ts +++ b/__TESTS__/unit/actions/Blur/Blur.test.ts @@ -1,45 +1,24 @@ -import {Region} from "../../../../src/qualifiers/region"; -import {Effect} from "../../../../src/actions/effect"; +import { Region } from "../../../../src/qualifiers/region"; +import { Effect } from "../../../../src/actions/effect"; -describe('Tests for Transformation Action -- Blur', () => { - it('Tests blur with and without strength', () => { - expect(Effect.blur() - .toString() - ).toEqual('e_blur'); +describe("Tests for Transformation Action -- Blur", () => { + it("Tests blur with and without strength", () => { + expect(Effect.blur().toString()).toEqual("e_blur"); - expect(Effect.blur() - .strength(10) - .toString() - ).toEqual('e_blur:10'); + expect(Effect.blur().strength(10).toString()).toEqual("e_blur:10"); }); - it('Test blur:faces', () => { - expect(Effect.blur() - .strength(50) - .region(Region.faces()).toString()).toBe('e_blur_faces:50'); + it("Test blur:faces", () => { + expect(Effect.blur().strength(50).region(Region.faces()).toString()).toBe("e_blur_faces:50"); }); - it('Test blur custom region', () => { - expect(Effect.blur() - .strength(10) - .region(Region.custom() - .height(20) - .width(30) - .x(40) - .y(50) - ) - .toString() - ) - .toEqual('e_blur_region:10,h_20,w_30,x_40,y_50'); + it("Test blur custom region", () => { + expect(Effect.blur().strength(10).region(Region.custom().height(20).width(30).x(40).y(50)).toString()).toEqual( + "e_blur_region:10,h_20,w_30,x_40,y_50" + ); }); - it('Test blur with Region.ocr', () => { - expect(Effect.blur() - .strength(10) - .region(Region.ocr() - ) - .toString() - ) - .toEqual('e_blur_region:10,g_ocr_text'); + it("Test blur with Region.ocr", () => { + expect(Effect.blur().strength(10).region(Region.ocr()).toString()).toEqual("e_blur_region:10,g_ocr_text"); }); }); diff --git a/__TESTS__/unit/actions/Border.test.ts b/__TESTS__/unit/actions/Border.test.ts index a91942e..d1fcb7e 100644 --- a/__TESTS__/unit/actions/Border.test.ts +++ b/__TESTS__/unit/actions/Border.test.ts @@ -1,49 +1,37 @@ -import {Border} from "../../../src/actions/border"; -import {Transformation} from "../../../src"; -import {RoundCorners} from "../../../src/actions/roundCorners"; +import { Border } from "../../../src/actions/border"; +import { Transformation } from "../../../src"; +import { RoundCorners } from "../../../src/actions/roundCorners"; +describe("Tests for Transformation Action -- Border", () => { + it("Creates a Transformation with border and color", () => { + const tx = new Transformation().border(Border.solid(7, "red")).toString(); -describe('Tests for Transformation Action -- Border', () => { - it('Creates a Transformation with border and color', () => { - const tx = new Transformation() - .border(Border.solid( 7, 'red')) - .toString(); - - expect(tx).toBe('bo_7px_solid_red'); + expect(tx).toBe("bo_7px_solid_red"); }); - it('Creates a Transformation with border and rgb #0000ff', () => { - const tx = new Transformation() - .border(Border.solid( 7, '#0000ff')) - .toString(); + it("Creates a Transformation with border and rgb #0000ff", () => { + const tx = new Transformation().border(Border.solid(7, "#0000ff")).toString(); - expect(tx).toBe('bo_7px_solid_rgb:0000ff'); + expect(tx).toBe("bo_7px_solid_rgb:0000ff"); }); - it('Creates a Transformation with border and rgb #FFF', () => { - const tx = new Transformation() - .border(Border.solid( 7, '#FFF')) - .toString(); + it("Creates a Transformation with border and rgb #FFF", () => { + const tx = new Transformation().border(Border.solid(7, "#FFF")).toString(); - expect(tx).toBe('bo_7px_solid_rgb:FFF'); + expect(tx).toBe("bo_7px_solid_rgb:FFF"); }); - it('Creates a Transformation with border and rgb #FFFFFFFF', () => { - const tx = new Transformation() - .border(Border.solid(7, '#FFFFFFFF')) - .toString(); + it("Creates a Transformation with border and rgb #FFFFFFFF", () => { + const tx = new Transformation().border(Border.solid(7, "#FFFFFFFF")).toString(); - expect(tx).toBe('bo_7px_solid_rgb:FFFFFFFF'); + expect(tx).toBe("bo_7px_solid_rgb:FFFFFFFF"); }); - it('Creates a Transformation with border and rgb #FFFFFFFF and round corners', () => { + it("Creates a Transformation with border and rgb #FFFFFFFF and round corners", () => { const tx = new Transformation() - .border( - Border.solid(7, '#FFFFFFFF') - .roundCorners(RoundCorners.byRadius(50)) - ) + .border(Border.solid(7, "#FFFFFFFF").roundCorners(RoundCorners.byRadius(50))) .toString(); - expect(tx).toBe('bo_7px_solid_rgb:FFFFFFFF,r_50'); + expect(tx).toBe("bo_7px_solid_rgb:FFFFFFFF,r_50"); }); }); diff --git a/__TESTS__/unit/actions/Conditional.test.ts b/__TESTS__/unit/actions/Conditional.test.ts index 01326cf..ec60bbe 100644 --- a/__TESTS__/unit/actions/Conditional.test.ts +++ b/__TESTS__/unit/actions/Conditional.test.ts @@ -1,23 +1,25 @@ -import {Conditional} from "../../../src/actions/conditional"; -import {Transformation} from "../../../src/transformation/Transformation"; -import {Resize} from "../../../src/actions/resize"; +import { Conditional } from "../../../src/actions/conditional"; +import { Transformation } from "../../../src/transformation/Transformation"; +import { Resize } from "../../../src/actions/resize"; - -describe('Tests for Transformation Action -- Conditional', () => { - it('Creates a conditional transformation', () => { - const tx = new Transformation().conditional( - Conditional.ifCondition('ar >= 1.0', new Transformation().addAction('w_100')) - ).toString(); +describe("Tests for Transformation Action -- Conditional", () => { + it("Creates a conditional transformation", () => { + const tx = new Transformation() + .conditional(Conditional.ifCondition("ar >= 1.0", new Transformation().addAction("w_100"))) + .toString(); // Ensures it compiles and doesn't throw - expect(tx).toEqual('if_ar_gte_1.0/w_100/if_end'); + expect(tx).toEqual("if_ar_gte_1.0/w_100/if_end"); }); - it('Conditional with if/else combination', () => { - const tx = new Transformation().conditional( - Conditional.ifCondition('ar >= 1.0', new Transformation().resize(Resize.scale(50))) - .otherwise(new Transformation().resize(Resize.scale(200))) - ).toString(); + it("Conditional with if/else combination", () => { + const tx = new Transformation() + .conditional( + Conditional.ifCondition("ar >= 1.0", new Transformation().resize(Resize.scale(50))).otherwise( + new Transformation().resize(Resize.scale(200)) + ) + ) + .toString(); - expect(tx).toEqual('if_ar_gte_1.0/c_scale,w_50/if_else/c_scale,w_200/if_end'); + expect(tx).toEqual("if_ar_gte_1.0/c_scale,w_50/if_else/c_scale,w_200/if_end"); }); }); diff --git a/__TESTS__/unit/actions/CustomFunction.test.ts b/__TESTS__/unit/actions/CustomFunction.test.ts index 8e27387..90b8f40 100644 --- a/__TESTS__/unit/actions/CustomFunction.test.ts +++ b/__TESTS__/unit/actions/CustomFunction.test.ts @@ -1,26 +1,26 @@ -import {CustomFunction} from "../../../src/actions/customFunction"; -import {Transformation} from "../../../src"; +import { CustomFunction } from "../../../src/actions/customFunction"; +import { Transformation } from "../../../src"; +describe("Tests for Transformation Action -- NamedTransformation", () => { + it("Works with wasm", () => { + const tx = new Transformation().customFunction(CustomFunction.wasm("my/example.wasm")).toString(); -describe('Tests for Transformation Action -- NamedTransformation', () => { - it ('Works with wasm', () => { - const tx = new Transformation() - .customFunction(CustomFunction.wasm('my/example.wasm')).toString(); - - expect(tx).toContain('fn_wasm:my:example.wasm'); + expect(tx).toContain("fn_wasm:my:example.wasm"); }); - it ('Works with remote', () => { + it("Works with remote", () => { const tx = new Transformation() - .customFunction(CustomFunction.remote('https://my.preprocess.custom/function')).toString(); + .customFunction(CustomFunction.remote("https://my.preprocess.custom/function")) + .toString(); - expect(tx).toContain('fn_remote:aHR0cHM6Ly9teS5wcmVwcm9jZXNzLmN1c3RvbS9mdW5jdGlvbg'); + expect(tx).toContain("fn_remote:aHR0cHM6Ly9teS5wcmVwcm9jZXNzLmN1c3RvbS9mdW5jdGlvbg"); }); - it ('Works with remote preprocessed', () => { + it("Works with remote preprocessed", () => { const tx = new Transformation() - .customFunction(CustomFunction.remote('https://my.preprocess.custom/function').preprocess()).toString(); + .customFunction(CustomFunction.remote("https://my.preprocess.custom/function").preprocess()) + .toString(); - expect(tx).toContain('fn_pre:remote:aHR0cHM6Ly9teS5wcmVwcm9jZXNzLmN1c3RvbS9mdW5jdGlvbg'); + expect(tx).toContain("fn_pre:remote:aHR0cHM6Ly9teS5wcmVwcm9jZXNzLmN1c3RvbS9mdW5jdGlvbg"); }); }); diff --git a/__TESTS__/unit/actions/Delivery.test.ts b/__TESTS__/unit/actions/Delivery.test.ts index 10e0483..08c82f4 100644 --- a/__TESTS__/unit/actions/Delivery.test.ts +++ b/__TESTS__/unit/actions/Delivery.test.ts @@ -1,351 +1,269 @@ -import {Format} from "../../../src/qualifiers/format"; -import {Quality} from "../../../src/qualifiers/quality"; -import {ColorSpace} from "../../../src/qualifiers/colorSpace"; -import {Dpr} from "../../../src/qualifiers/dpr"; -import {Delivery} from "../../../src/actions/delivery"; -import {Transformation} from "../../../src"; -import {Progressive} from "../../../src/qualifiers/progressive"; - - -const {format} = Delivery; - -describe('Tests for Transformation Action -- Delivery', () => { - it('Ensure namespace is correctly populated', () => { +import { Format } from "../../../src/qualifiers/format"; +import { Quality } from "../../../src/qualifiers/quality"; +import { ColorSpace } from "../../../src/qualifiers/colorSpace"; +import { Dpr } from "../../../src/qualifiers/dpr"; +import { Delivery } from "../../../src/actions/delivery"; +import { Transformation } from "../../../src"; +import { Progressive } from "../../../src/qualifiers/progressive"; + +const { format } = Delivery; + +describe("Tests for Transformation Action -- Delivery", () => { + it("Ensure namespace is correctly populated", () => { expect(Delivery.format).toEqual(format); }); - it('Creates a Transformation with format using string', () => { - const tx = new Transformation() - .delivery(Delivery.format(Format.auto())) - .toString(); + it("Creates a Transformation with format using string", () => { + const tx = new Transformation().delivery(Delivery.format(Format.auto())).toString(); - expect(tx).toBe('f_auto'); + expect(tx).toBe("f_auto"); }); - it('Creates a Transformation with quality alias', () => { - const tx = new Transformation() - .quality('auto') - .toString(); - expect(tx).toBe('q_auto'); + it("Creates a Transformation with quality alias", () => { + const tx = new Transformation().quality("auto").toString(); + expect(tx).toBe("q_auto"); }); - it('Creates a Transformation with format alias', () => { - const tx = new Transformation() - .format('gif') - .toString(); - expect(tx).toBe('f_gif'); + it("Creates a Transformation with format alias", () => { + const tx = new Transformation().format("gif").toString(); + expect(tx).toBe("f_gif"); }); - it('Creates a Transformation with Format', () => { - const tx = new Transformation() - .delivery(format(Format.gif())) - .toString(); + it("Creates a Transformation with Format", () => { + const tx = new Transformation().delivery(format(Format.gif())).toString(); - expect(tx).toBe('f_gif'); + expect(tx).toBe("f_gif"); }); - it('Creates a Transformation with gif.lossy()', () => { - const tx = new Transformation() - .delivery(format(Format.gif()).lossy()) - .toString(); + it("Creates a Transformation with gif.lossy()", () => { + const tx = new Transformation().delivery(format(Format.gif()).lossy()).toString(); - expect(tx).toBe('f_gif,fl_lossy'); + expect(tx).toBe("f_gif,fl_lossy"); }); - it('Creates a Transformation with auto.lossy()', () => { - const tx = new Transformation() - .delivery(format(Format.auto()).lossy()) - .toString(); + it("Creates a Transformation with auto.lossy()", () => { + const tx = new Transformation().delivery(format(Format.auto()).lossy()).toString(); - expect(tx).toBe('f_auto,fl_lossy'); + expect(tx).toBe("f_auto,fl_lossy"); }); - it('Creates a Transformation with jpg.progressive()', () => { - const tx = new Transformation() - .delivery(format(Format.jpg()).progressive()) - .toString(); + it("Creates a Transformation with jpg.progressive()", () => { + const tx = new Transformation().delivery(format(Format.jpg()).progressive()).toString(); - expect(tx).toBe('f_jpg,fl_progressive'); + expect(tx).toBe("f_jpg,fl_progressive"); }); - it('Creates a Transformation with png', () => { - const tx = new Transformation() - .delivery(format(Format.png())) - .toString(); + it("Creates a Transformation with png", () => { + const tx = new Transformation().delivery(format(Format.png())).toString(); - expect(tx).toBe('f_png'); + expect(tx).toBe("f_png"); }); - it('Creates a Transformation with bmp', () => { - const tx = new Transformation() - .delivery(format(Format.bmp())) - .toString(); + it("Creates a Transformation with bmp", () => { + const tx = new Transformation().delivery(format(Format.bmp())).toString(); - expect(tx).toBe('f_bmp'); + expect(tx).toBe("f_bmp"); }); - it('Creates a Transformation with ico', () => { - const tx = new Transformation() - .delivery(format(Format.ico())) - .toString(); + it("Creates a Transformation with ico", () => { + const tx = new Transformation().delivery(format(Format.ico())).toString(); - expect(tx).toBe('f_ico'); + expect(tx).toBe("f_ico"); }); - it('Creates a Transformation with pdf', () => { - const tx = new Transformation() - .delivery(format(Format.pdf())) - .toString(); + it("Creates a Transformation with pdf", () => { + const tx = new Transformation().delivery(format(Format.pdf())).toString(); - expect(tx).toBe('f_pdf'); + expect(tx).toBe("f_pdf"); }); - it('Creates a Transformation with eps', () => { - const tx = new Transformation() - .delivery(format(Format.eps())) - .toString(); + it("Creates a Transformation with eps", () => { + const tx = new Transformation().delivery(format(Format.eps())).toString(); - expect(tx).toBe('f_eps'); + expect(tx).toBe("f_eps"); }); - it('Creates a Transformation with tiff', () => { - const tx = new Transformation() - .delivery(format(Format.tiff())) - .toString(); + it("Creates a Transformation with tiff", () => { + const tx = new Transformation().delivery(format(Format.tiff())).toString(); - expect(tx).toBe('f_tiff'); + expect(tx).toBe("f_tiff"); }); - it('Creates a Transformation with webp', () => { - const tx = new Transformation() - .delivery(format(Format.webp())) - .toString(); + it("Creates a Transformation with webp", () => { + const tx = new Transformation().delivery(format(Format.webp())).toString(); - expect(tx).toBe('f_webp'); + expect(tx).toBe("f_webp"); }); - it('Creates a Transformation with psd', () => { - const tx = new Transformation() - .delivery(format(Format.psd())) - .toString(); + it("Creates a Transformation with psd", () => { + const tx = new Transformation().delivery(format(Format.psd())).toString(); - expect(tx).toBe('f_psd'); + expect(tx).toBe("f_psd"); }); - it('Creates a Transformation with jpc', () => { - const tx = new Transformation() - .delivery(format(Format.jpc())) - .toString(); + it("Creates a Transformation with jpc", () => { + const tx = new Transformation().delivery(format(Format.jpc())).toString(); - expect(tx).toBe('f_jpc'); + expect(tx).toBe("f_jpc"); }); - it('Creates a Transformation with wdp', () => { - const tx = new Transformation() - .delivery(format(Format.wdp())) - .toString(); + it("Creates a Transformation with wdp", () => { + const tx = new Transformation().delivery(format(Format.wdp())).toString(); - expect(tx).toBe('f_wdp'); + expect(tx).toBe("f_wdp"); }); - it('Creates a Transformation with webp', () => { - const tx = new Transformation() - .delivery(format(Format.webp())) - .toString(); + it("Creates a Transformation with webp", () => { + const tx = new Transformation().delivery(format(Format.webp())).toString(); - expect(tx).toBe('f_webp'); + expect(tx).toBe("f_webp"); }); + it("Creates a Transformation with svg", () => { + const tx = new Transformation().delivery(format(Format.svg())).toString(); - it('Creates a Transformation with svg', () => { - const tx = new Transformation() - .delivery(format(Format.svg())) - .toString(); - - expect(tx).toBe('f_svg'); + expect(tx).toBe("f_svg"); }); - it('Creates a Transformation with heic', () => { - const tx = new Transformation() - .delivery(format(Format.heic())) - .toString(); + it("Creates a Transformation with heic", () => { + const tx = new Transformation().delivery(format(Format.heic())).toString(); - expect(tx).toBe('f_heic'); + expect(tx).toBe("f_heic"); }); - it('Creates a Transformation with flif', () => { - const tx = new Transformation() - .delivery(format(Format.flif())) - .toString(); + it("Creates a Transformation with flif", () => { + const tx = new Transformation().delivery(format(Format.flif())).toString(); - expect(tx).toBe('f_flif'); + expect(tx).toBe("f_flif"); }); - it('Creates a Transformation with ai', () => { - const tx = new Transformation() - .delivery(format(Format.ai())) - .toString(); + it("Creates a Transformation with ai", () => { + const tx = new Transformation().delivery(format(Format.ai())).toString(); - expect(tx).toBe('f_ai'); + expect(tx).toBe("f_ai"); }); - it('Creates a Transformation with jp2', () => { - const tx = new Transformation() - .delivery(format(Format.jp2())) - .toString(); + it("Creates a Transformation with jp2", () => { + const tx = new Transformation().delivery(format(Format.jp2())).toString(); - expect(tx).toBe('f_jp2'); + expect(tx).toBe("f_jp2"); }); - it('Creates a Transformation with Delivery.dpr', () => { - const tx = new Transformation() - .delivery(Delivery.dpr('2.0')) - .toString(); + it("Creates a Transformation with Delivery.dpr", () => { + const tx = new Transformation().delivery(Delivery.dpr("2.0")).toString(); - expect(tx).toBe('dpr_2.0'); + expect(tx).toBe("dpr_2.0"); }); - it('Creates a Transformation with Delivery.dpr', () => { - const tx = new Transformation() - .delivery(Delivery.dpr(Dpr.auto())) - .toString(); + it("Creates a Transformation with Delivery.dpr", () => { + const tx = new Transformation().delivery(Delivery.dpr(Dpr.auto())).toString(); - expect(tx).toBe('dpr_auto'); + expect(tx).toBe("dpr_auto"); }); - it('Creates a Transformation with Delivery.quality', () => { - const tx = new Transformation() - .delivery(Delivery.quality('80')) - .toString(); + it("Creates a Transformation with Delivery.quality", () => { + const tx = new Transformation().delivery(Delivery.quality("80")).toString(); - expect(tx).toBe('q_80'); + expect(tx).toBe("q_80"); }); - it('Creates a Transformation with Delivery.quality.auto()', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.auto())) - .toString(); + it("Creates a Transformation with Delivery.quality.auto()", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.auto())).toString(); - expect(tx).toBe('q_auto'); + expect(tx).toBe("q_auto"); }); - it('Can use shortened quality notation', () => { - const tx = new Transformation() - .delivery(Delivery.quality('auto:best')) - .toString(); + it("Can use shortened quality notation", () => { + const tx = new Transformation().delivery(Delivery.quality("auto:best")).toString(); - expect(tx).toBe('q_auto:best'); + expect(tx).toBe("q_auto:best"); }); - it('Creates a Transformation with Delivery.density', () => { - const tx = new Transformation() - .delivery(Delivery.density(150)) - .toString(); + it("Creates a Transformation with Delivery.density", () => { + const tx = new Transformation().delivery(Delivery.density(150)).toString(); - expect(tx).toBe('dn_150'); + expect(tx).toBe("dn_150"); }); - it('Creates a Transformation with Delivery.defaultImage', () => { - const tx = new Transformation() - .delivery(Delivery.defaultImage('default')) - .toString(); + it("Creates a Transformation with Delivery.defaultImage", () => { + const tx = new Transformation().delivery(Delivery.defaultImage("default")).toString(); - expect(tx).toBe('d_default'); + expect(tx).toBe("d_default"); }); - it('Creates a Transformation with Delivery.colorspace', () => { - const tx = new Transformation() - .delivery(Delivery.colorSpace(ColorSpace.noCmyk())) - .toString(); + it("Creates a Transformation with Delivery.colorspace", () => { + const tx = new Transformation().delivery(Delivery.colorSpace(ColorSpace.noCmyk())).toString(); - expect(tx).toBe('cs_no_cmyk'); + expect(tx).toBe("cs_no_cmyk"); }); - it('Creates a Transformation with shortened ColorSpaceType', () => { - const tx = new Transformation() - .delivery(Delivery.colorSpace("no_cmyk")) - .toString(); + it("Creates a Transformation with shortened ColorSpaceType", () => { + const tx = new Transformation().delivery(Delivery.colorSpace("no_cmyk")).toString(); - expect(tx).toBe('cs_no_cmyk'); + expect(tx).toBe("cs_no_cmyk"); }); - it('Creates a Transformation with Delivery.ColorSpaceFromICC', () => { - const tx = new Transformation() - .delivery(Delivery.colorSpaceFromICC('sample')) - .toString(); + it("Creates a Transformation with Delivery.ColorSpaceFromICC", () => { + const tx = new Transformation().delivery(Delivery.colorSpaceFromICC("sample")).toString(); - expect(tx).toBe('cs_icc:sample'); + expect(tx).toBe("cs_icc:sample"); }); - it('Created delivery formats with progressive', () => { + it("Created delivery formats with progressive", () => { // f_jpg,fl_progressive - const tx = new Transformation().delivery( - Delivery.format(Format.jpg()).progressive(Progressive.progressive()) - ).toString(); + const tx = new Transformation() + .delivery(Delivery.format(Format.jpg()).progressive(Progressive.progressive())) + .toString(); - expect(tx).toContain('f_jpg,fl_progressive'); + expect(tx).toContain("f_jpg,fl_progressive"); }); - - - it('Created delivery formats with progressive', () => { + it("Created delivery formats with progressive", () => { // f_jpg,fl_progressive - const tx = new Transformation().delivery( - Delivery.format(Format.jpg()).progressive() - ).toString(); + const tx = new Transformation().delivery(Delivery.format(Format.jpg()).progressive()).toString(); - expect(tx).toContain('f_jpg,fl_progressive'); + expect(tx).toContain("f_jpg,fl_progressive"); }); - it('Created delivery formats with progressive:semi', () => { + it("Created delivery formats with progressive:semi", () => { // f_jpg,fl_progressive - const tx = new Transformation().delivery( - Delivery.format(Format.jpg()).progressive(Progressive.semi()) - ).toString(); + const tx = new Transformation().delivery(Delivery.format(Format.jpg()).progressive(Progressive.semi())).toString(); - expect(tx).toContain('f_jpg,fl_progressive:semi'); + expect(tx).toContain("f_jpg,fl_progressive:semi"); }); - it('Can use shortened progressive:semi notation', () => { + it("Can use shortened progressive:semi notation", () => { // f_jpg,fl_progressive - const tx = new Transformation().delivery( - Delivery.format(Format.jpg()).progressive("semi") - ).toString(); + const tx = new Transformation().delivery(Delivery.format(Format.jpg()).progressive("semi")).toString(); - expect(tx).toContain('f_jpg,fl_progressive:semi'); + expect(tx).toContain("f_jpg,fl_progressive:semi"); }); - it('Created delivery formats with progressive:steep', () => { + it("Created delivery formats with progressive:steep", () => { // f_jpg,fl_progressive - const tx = new Transformation().delivery( - Delivery.format(Format.jpg()).progressive(Progressive.steep()) - ).toString(); + const tx = new Transformation().delivery(Delivery.format(Format.jpg()).progressive(Progressive.steep())).toString(); - expect(tx).toContain('f_jpg,fl_progressive:steep'); + expect(tx).toContain("f_jpg,fl_progressive:steep"); }); - it('Created delivery formats with progressive:none', () => { + it("Created delivery formats with progressive:none", () => { // f_jpg,fl_progressive - const tx = new Transformation().delivery( - Delivery.format(Format.jpg()).progressive(Progressive.none()) - ).toString(); + const tx = new Transformation().delivery(Delivery.format(Format.jpg()).progressive(Progressive.none())).toString(); - expect(tx).toContain('f_jpg,fl_progressive:none'); + expect(tx).toContain("f_jpg,fl_progressive:none"); }); - it('Created delivery formats with progressive:none as a string', () => { + it("Created delivery formats with progressive:none as a string", () => { // f_jpg,fl_progressive - const tx = new Transformation().delivery( - Delivery.format(Format.jpg()).progressive('none') - ).toString(); + const tx = new Transformation().delivery(Delivery.format(Format.jpg()).progressive("none")).toString(); - expect(tx).toContain('f_jpg,fl_progressive:none'); + expect(tx).toContain("f_jpg,fl_progressive:none"); }); - it('Can use shortened format notation', () => { + it("Can use shortened format notation", () => { // f_jpg,fl_progressive - const tx = new Transformation().delivery(format('jpg')).toString(); + const tx = new Transformation().delivery(format("jpg")).toString(); - expect(tx).toContain('f_jpg'); + expect(tx).toContain("f_jpg"); }); }); diff --git a/__TESTS__/unit/actions/Effect.test.ts b/__TESTS__/unit/actions/Effect.test.ts index f0b32aa..e6e924f 100644 --- a/__TESTS__/unit/actions/Effect.test.ts +++ b/__TESTS__/unit/actions/Effect.test.ts @@ -1,18 +1,17 @@ -import {image} from "../../../src/qualifiers/source"; -import {rodMonochromacy} from "../../../src/qualifiers/simulateColorBlind"; -import {Color} from "../../../src/qualifiers/color"; -import {scale} from "../../../src/actions/resize"; -import {GradientFade} from "../../../src/qualifiers/GradientFade"; -import {cartoonify, Effect} from "../../../src/actions/effect"; -import {OutlineMode} from "../../../src/qualifiers/outlineMode"; -import {halftone4x4Orthogonal} from "../../../src/qualifiers/dither"; -import {ArtisticFilter} from "../../../src/qualifiers/artisticFilter"; -import {Transformation} from "../../../src"; -import {ShakeStrength} from "../../../src/qualifiers/shakeStrength"; - - -describe('Tests for Transformation Action -- Effect', () => { - it('Creates a Transformation with Simple and Leveled effects', () => { +import { image } from "../../../src/qualifiers/source"; +import { rodMonochromacy } from "../../../src/qualifiers/simulateColorBlind"; +import { Color } from "../../../src/qualifiers/color"; +import { scale } from "../../../src/actions/resize"; +import { GradientFade } from "../../../src/qualifiers/GradientFade"; +import { cartoonify, Effect } from "../../../src/actions/effect"; +import { OutlineMode } from "../../../src/qualifiers/outlineMode"; +import { halftone4x4Orthogonal } from "../../../src/qualifiers/dither"; +import { ArtisticFilter } from "../../../src/qualifiers/artisticFilter"; +import { Transformation } from "../../../src"; +import { ShakeStrength } from "../../../src/qualifiers/shakeStrength"; + +describe("Tests for Transformation Action -- Effect", () => { + it("Creates a Transformation with Simple and Leveled effects", () => { const tx = new Transformation() .effect(Effect.advancedRedEye()) .effect(Effect.accelerate()) @@ -33,7 +32,7 @@ describe('Tests for Transformation Action -- Effect', () => { .effect(Effect.makeTransparent()) .effect(Effect.makeTransparent(100)) .effect(Effect.makeTransparent().tolerance(5)) - .effect(Effect.makeTransparent().tolerance(5).colorToReplace('red')) + .effect(Effect.makeTransparent().tolerance(5).colorToReplace("red")) .effect(Effect.noise()) .effect(Effect.noise(100)) .effect(Effect.noise().level(5)) @@ -53,291 +52,232 @@ describe('Tests for Transformation Action -- Effect', () => { .toString(); const expectedToContain = [ - 'e_adv_redeye', - 'e_accelerate', - 'e_accelerate:100', - 'e_accelerate:5', - 'e_boomerang', - 'e_blackwhite', - 'e_blackwhite:10', - 'e_blackwhite:20', - 'e_fade:100', - 'e_fade:5', - 'e_fade:-100', - 'e_fade:-5', - 'e_grayscale', - 'e_loop', - 'e_loop:100', - 'e_loop:5', - 'e_make_transparent', - 'e_make_transparent:100', - 'e_make_transparent:5', - 'co_red,e_make_transparent:5', - 'e_noise', - 'e_noise:100', - 'e_noise:5', - 'e_negate', - 'e_reverse', - 'e_redeye', - 'e_sepia', - 'e_sepia:100', - 'e_sepia:5', - 'e_vignette', - 'e_vignette:100', - 'e_vignette:5', - 'e_deshake', - 'e_deshake:10', - 'e_deshake:16' - ].join('/'); + "e_adv_redeye", + "e_accelerate", + "e_accelerate:100", + "e_accelerate:5", + "e_boomerang", + "e_blackwhite", + "e_blackwhite:10", + "e_blackwhite:20", + "e_fade:100", + "e_fade:5", + "e_fade:-100", + "e_fade:-5", + "e_grayscale", + "e_loop", + "e_loop:100", + "e_loop:5", + "e_make_transparent", + "e_make_transparent:100", + "e_make_transparent:5", + "co_red,e_make_transparent:5", + "e_noise", + "e_noise:100", + "e_noise:5", + "e_negate", + "e_reverse", + "e_redeye", + "e_sepia", + "e_sepia:100", + "e_sepia:5", + "e_vignette", + "e_vignette:100", + "e_vignette:5", + "e_deshake", + "e_deshake:10", + "e_deshake:16", + ].join("/"); expect(tx).toBe(`${expectedToContain}`); }); - it('Creates a Transformation with effect shadow:50', () => { + it("Creates a Transformation with effect shadow:50", () => { const tx = new Transformation() .effect(Effect.shadow()) .effect(Effect.shadow(50)) - .effect(Effect.shadow().strength(60).offsetX(1).offsetY(2).color('red')) + .effect(Effect.shadow().strength(60).offsetX(1).offsetY(2).color("red")) .toString(); - expect(tx).toContain('e_shadow/e_shadow:50/co_red,e_shadow:60,x_1,y_2'); + expect(tx).toContain("e_shadow/e_shadow:50/co_red,e_shadow:60,x_1,y_2"); }); - it('Creates a Transformation with effect colorize', () => { - const tx = new Transformation() - .effect(Effect.colorize(10).color('red')) - .toString(); + it("Creates a Transformation with effect colorize", () => { + const tx = new Transformation().effect(Effect.colorize(10).color("red")).toString(); - expect(tx).toBe('co_red,e_colorize:10'); + expect(tx).toBe("co_red,e_colorize:10"); }); - it('Creates a Transformation with effect colorize:level', () => { - const tx = new Transformation() - .effect(Effect.colorize(50)) - .toString(); + it("Creates a Transformation with effect colorize:level", () => { + const tx = new Transformation().effect(Effect.colorize(50)).toString(); - expect(tx).toBe('e_colorize:50'); + expect(tx).toBe("e_colorize:50"); }); - it('Creates a Transformation with effect colorize:level', () => { - const tx = new Transformation() - .effect(Effect.colorize().level(10)) - .toString(); + it("Creates a Transformation with effect colorize:level", () => { + const tx = new Transformation().effect(Effect.colorize().level(10)).toString(); - expect(tx).toBe('e_colorize:10'); + expect(tx).toBe("e_colorize:10"); }); - it('Creates a Transformation with effect oilPaint', () => { - const tx = new Transformation() - .effect(Effect.oilPaint().strength(10)) - .toString(); + it("Creates a Transformation with effect oilPaint", () => { + const tx = new Transformation().effect(Effect.oilPaint().strength(10)).toString(); - expect(tx).toBe('e_oil_paint:10'); + expect(tx).toBe("e_oil_paint:10"); }); - it('Creates a Transformation with effect oilPaint:level', () => { - const tx = new Transformation() - .effect(Effect.oilPaint(50)) - .toString(); + it("Creates a Transformation with effect oilPaint:level", () => { + const tx = new Transformation().effect(Effect.oilPaint(50)).toString(); - expect(tx).toBe('e_oil_paint:50'); + expect(tx).toBe("e_oil_paint:50"); }); - it('Creates a Transformation with effect artisticFilter', () => { - const tx = new Transformation() - .effect(Effect.artisticFilter(ArtisticFilter.peacock())) - .toString(); + it("Creates a Transformation with effect artisticFilter", () => { + const tx = new Transformation().effect(Effect.artisticFilter(ArtisticFilter.peacock())).toString(); - expect(tx).toBe('e_art:peacock'); + expect(tx).toBe("e_art:peacock"); }); - it('Can use shortened artisticFilter notation', () => { - const tx = new Transformation() - .effect(Effect.artisticFilter("al_dente")) - .toString(); + it("Can use shortened artisticFilter notation", () => { + const tx = new Transformation().effect(Effect.artisticFilter("al_dente")).toString(); - expect(tx).toBe('e_art:al_dente'); + expect(tx).toBe("e_art:al_dente"); }); - it('Creates a Transformation with effect cartoonify:50', () => { - const tx = new Transformation() - .effect(cartoonify().lineStrength(50).blackwhite()) - .toString(); + it("Creates a Transformation with effect cartoonify:50", () => { + const tx = new Transformation().effect(cartoonify().lineStrength(50).blackwhite()).toString(); const withConstructor = cartoonify(50).blackwhite().toString(); const withBuilder = cartoonify().lineStrength(50).blackwhite().toString(); expect(withBuilder).toBe(withConstructor); - expect(tx).toBe('e_cartoonify:50:bw'); + expect(tx).toBe("e_cartoonify:50:bw"); }); - it('Creates a Transformation with effect style_transfer', () => { - const tx = new Transformation() - .effect(Effect.styleTransfer(image('woman'))) - .toString(); + it("Creates a Transformation with effect style_transfer", () => { + const tx = new Transformation().effect(Effect.styleTransfer(image("woman"))).toString(); - expect(tx).toContain('l_woman/e_style_transfer,fl_layer_apply'); + expect(tx).toContain("l_woman/e_style_transfer,fl_layer_apply"); }); - it('Creates a Transformation with effect style_transfer:strength', () => { - const tx = new Transformation() - .effect(Effect.styleTransfer(image('woman')).strength(15)) - .toString(); + it("Creates a Transformation with effect style_transfer:strength", () => { + const tx = new Transformation().effect(Effect.styleTransfer(image("woman")).strength(15)).toString(); - expect(tx).toContain('l_woman/e_style_transfer:15,fl_layer_apply'); + expect(tx).toContain("l_woman/e_style_transfer:15,fl_layer_apply"); }); - it('Creates a Transformation with effect style_transfer:preserve_color:strength', () => { + it("Creates a Transformation with effect style_transfer:preserve_color:strength", () => { const tx = new Transformation() - .effect(Effect.styleTransfer(image('woman')) - .strength(15) - .preserveColor() - ) + .effect(Effect.styleTransfer(image("woman")).strength(15).preserveColor()) .toString(); - expect(tx).toContain('l_woman/e_style_transfer:preserve_color:15,fl_layer_apply'); + expect(tx).toContain("l_woman/e_style_transfer:preserve_color:15,fl_layer_apply"); }); - it('Creates a Transformation with effect style_transfer:preserve_color:strength with a transformation', () => { + it("Creates a Transformation with effect style_transfer:preserve_color:strength with a transformation", () => { const tx = new Transformation() - .effect(Effect.styleTransfer( - image('woman') - .transformation( - new Transformation().resize(scale(100, 100)) - )) - .strength(15) - .preserveColor() + .effect( + Effect.styleTransfer(image("woman").transformation(new Transformation().resize(scale(100, 100)))) + .strength(15) + .preserveColor() ) .toString(); - expect(tx).toContain('l_woman/c_scale,h_100,w_100/e_style_transfer:preserve_color:15,fl_layer_apply'); + expect(tx).toContain("l_woman/c_scale,h_100,w_100/e_style_transfer:preserve_color:15,fl_layer_apply"); }); - it('Tests for Effect.dither', () => { + it("Tests for Effect.dither", () => { const tx = new Transformation() .effect(Effect.dither()) .effect(Effect.dither(halftone4x4Orthogonal())) .effect(Effect.dither().type(halftone4x4Orthogonal())) .toString(); - expect(tx).toContain('e_ordered_dither/e_ordered_dither:9/e_ordered_dither:9'); + expect(tx).toContain("e_ordered_dither/e_ordered_dither:9/e_ordered_dither:9"); }); - it('Test Vectorize', () => { - - expect(Effect.vectorize() - .toString() - ).toEqual('e_vectorize'); + it("Test Vectorize", () => { + expect(Effect.vectorize().toString()).toEqual("e_vectorize"); - expect(Effect.vectorize() + expect( + Effect.vectorize() - .cornersLevel(1) - .despeckleLevel(2) - .detailsLevel(3) - .paths(4) - .numOfColors(5) - .toString() - ).toEqual('e_vectorize:colors:5:detail:3:despeckle:2:paths:4:corners:1'); + .cornersLevel(1) + .despeckleLevel(2) + .detailsLevel(3) + .paths(4) + .numOfColors(5) + .toString() + ).toEqual("e_vectorize:colors:5:detail:3:despeckle:2:paths:4:corners:1"); }); - it('Test gradientFade', () => { + it("Test gradientFade", () => { // e_gradient_fade:{type}:{strength},x_{x},y_{y} - expect(Effect.gradientFade() - .toString() - ).toBe('e_gradient_fade'); - - expect(Effect.gradientFade() - .strength(5) - .toString() - ).toBe('e_gradient_fade:5'); - - expect(Effect.gradientFade() - .type(GradientFade.symmetricPad()) - .strength(5) - .horizontalStartPoint(10) - .verticalStartPoint(20) - .toString() - ).toBe('e_gradient_fade:symmetric_pad:5,x_10,y_20'); + expect(Effect.gradientFade().toString()).toBe("e_gradient_fade"); + + expect(Effect.gradientFade().strength(5).toString()).toBe("e_gradient_fade:5"); + + expect( + Effect.gradientFade() + .type(GradientFade.symmetricPad()) + .strength(5) + .horizontalStartPoint(10) + .verticalStartPoint(20) + .toString() + ).toBe("e_gradient_fade:symmetric_pad:5,x_10,y_20"); }); - it('Test assistColorBlind', () => { - expect(Effect.assistColorBlind() - .toString() - ).toBe('e_assist_colorblind'); - - expect(Effect.assistColorBlind() - .xray() - .toString() - ).toBe('e_assist_colorblind:xray'); - - expect(Effect.assistColorBlind() - .xray() - .stripesStrength(10) - .toString() - ).toBe('e_assist_colorblind:10'); - - expect(Effect.assistColorBlind() - .stripesStrength(10) - .xray() - .toString() - ).toBe('e_assist_colorblind:xray'); + it("Test assistColorBlind", () => { + expect(Effect.assistColorBlind().toString()).toBe("e_assist_colorblind"); + + expect(Effect.assistColorBlind().xray().toString()).toBe("e_assist_colorblind:xray"); + + expect(Effect.assistColorBlind().xray().stripesStrength(10).toString()).toBe("e_assist_colorblind:10"); + + expect(Effect.assistColorBlind().stripesStrength(10).xray().toString()).toBe("e_assist_colorblind:xray"); }); - it('Test Effect.outline', () => { + it("Test Effect.outline", () => { // co_{color},e_outline:{mode}:{width}:{blurLevel} - expect(Effect.outline() - .toString() - ).toBe('e_outline'); - - expect(Effect.outline() - .mode(OutlineMode.fill()) - .width(10) - .blurLevel(25) - .color(Color.BLUE) - .toString() - ).toBe('co_blue,e_outline:fill:10:25'); + expect(Effect.outline().toString()).toBe("e_outline"); + + expect(Effect.outline().mode(OutlineMode.fill()).width(10).blurLevel(25).color(Color.BLUE).toString()).toBe( + "co_blue,e_outline:fill:10:25" + ); }); - it('Can use shortened Effect.outline notation', () => { - expect(Effect.outline() - .mode("fill") - .width(10) - .blurLevel(25) - .color(Color.BLUE) - .toString() - ).toBe('co_blue,e_outline:fill:10:25'); + it("Can use shortened Effect.outline notation", () => { + expect(Effect.outline().mode("fill").width(10).blurLevel(25).color(Color.BLUE).toString()).toBe( + "co_blue,e_outline:fill:10:25" + ); }); - it('Test simulateColorBlind', () => { - expect(Effect.simulateColorBlind() - .toString() - ).toBe('e_simulate_colorblind'); + it("Test simulateColorBlind", () => { + expect(Effect.simulateColorBlind().toString()).toBe("e_simulate_colorblind"); - expect(Effect.simulateColorBlind() - .condition(rodMonochromacy()) - .toString() - ).toBe('e_simulate_colorblind:rod_monochromacy'); + expect(Effect.simulateColorBlind().condition(rodMonochromacy()).toString()).toBe( + "e_simulate_colorblind:rod_monochromacy" + ); }); - it('Can shorten simulateColorBlindType notation', () => { - expect(Effect.simulateColorBlind() - .condition("deuteranomaly") - .toString() - ).toBe('e_simulate_colorblind:deuteranomaly'); + it("Can shorten simulateColorBlindType notation", () => { + expect(Effect.simulateColorBlind().condition("deuteranomaly").toString()).toBe( + "e_simulate_colorblind:deuteranomaly" + ); }); - it('Test removeBackground', () => { - expect(Effect.removeBackground().toString()).toBe('e_bgremoval'); - expect(Effect.removeBackground().screen().toString()).toBe('e_bgremoval:screen'); - expect(Effect.removeBackground().colorToRemove(Color.RED).toString()).toBe('e_bgremoval:red'); - expect(Effect.removeBackground().screen().colorToRemove(Color.RED).toString()).toBe('e_bgremoval:screen:red'); - expect(Effect.removeBackground().screen().colorToRemove('#fff').toString()).toBe('e_bgremoval:screen:fff'); + it("Test removeBackground", () => { + expect(Effect.removeBackground().toString()).toBe("e_bgremoval"); + expect(Effect.removeBackground().screen().toString()).toBe("e_bgremoval:screen"); + expect(Effect.removeBackground().colorToRemove(Color.RED).toString()).toBe("e_bgremoval:red"); + expect(Effect.removeBackground().screen().colorToRemove(Color.RED).toString()).toBe("e_bgremoval:screen:red"); + expect(Effect.removeBackground().screen().colorToRemove("#fff").toString()).toBe("e_bgremoval:screen:fff"); }); - it('Test theme effect', () => { - expect(Effect.theme('red').toString()).toBe('e_theme:color_red'); - expect(Effect.theme('#fff').toString()).toBe('e_theme:color_fff'); - expect(Effect.theme('fff').toString()).toBe('e_theme:color_fff'); - expect(Effect.theme('red').photosensitivity(50).toString()).toBe('e_theme:color_red:photosensitivity_50'); + it("Test theme effect", () => { + expect(Effect.theme("red").toString()).toBe("e_theme:color_red"); + expect(Effect.theme("#fff").toString()).toBe("e_theme:color_fff"); + expect(Effect.theme("fff").toString()).toBe("e_theme:color_fff"); + expect(Effect.theme("red").photosensitivity(50).toString()).toBe("e_theme:color_red:photosensitivity_50"); }); }); diff --git a/__TESTS__/unit/actions/Extract.test.ts b/__TESTS__/unit/actions/Extract.test.ts index 83c115b..15f19d6 100644 --- a/__TESTS__/unit/actions/Extract.test.ts +++ b/__TESTS__/unit/actions/Extract.test.ts @@ -1,53 +1,28 @@ -import {Extract} from "../../../src/actions/extract"; -import {Transformation} from "../../../src"; +import { Extract } from "../../../src/actions/extract"; +import { Transformation } from "../../../src"; -describe('Tests for Transformation Action -- Extract', () => { - it('Creates a Transformation with getFrame.byNumber', () => { - const tx = new Transformation() - .extract(Extract.getFrame().byNumber(4)) - .toString(); +describe("Tests for Transformation Action -- Extract", () => { + it("Creates a Transformation with getFrame.byNumber", () => { + const tx = new Transformation().extract(Extract.getFrame().byNumber(4)).toString(); - expect(tx).toBe('pg_4'); + expect(tx).toBe("pg_4"); }); - it('Creates a Transformation with getFrame.byRange', () => { - const tx = new Transformation() - .extract(Extract.getFrame().byRange(4, 10)) - .toString(); + it("Creates a Transformation with getFrame.byRange", () => { + const tx = new Transformation().extract(Extract.getFrame().byRange(4, 10)).toString(); - expect(tx).toBe('pg_4-10'); + expect(tx).toBe("pg_4-10"); }); + it("Uses multiple qualifiers", () => { + expect(Extract.getFrame().byNumber(1).byRange(5, 7).toString()).toBe("pg_1;5-7"); // pg_1;5-7 - it('Uses multiple qualifiers', () => { - expect(Extract - .getFrame() - .byNumber(1) - .byRange(5, 7) - .toString() - ).toBe('pg_1;5-7'); // pg_1;5-7 - - expect(Extract - .getFrame() - .byRange(4, 7) - .byNumber(9) - .toString() - ).toBe('pg_4-7;9'); + expect(Extract.getFrame().byRange(4, 7).byNumber(9).toString()).toBe("pg_4-7;9"); }); - it('Uses multiple qualifeirs in getPage', () => { - expect(Extract - .getPage() - .byNumber(1) - .byRange(5, 7) - .toString() - ).toBe('pg_1;5-7'); // pg_1;5-7 - - expect(Extract - .getPage() - .byRange(4, 7) - .byNumber(9) - .toString() - ).toBe('pg_4-7;9'); + it("Uses multiple qualifeirs in getPage", () => { + expect(Extract.getPage().byNumber(1).byRange(5, 7).toString()).toBe("pg_1;5-7"); // pg_1;5-7 + + expect(Extract.getPage().byRange(4, 7).byNumber(9).toString()).toBe("pg_4-7;9"); }); }); diff --git a/__TESTS__/unit/actions/Flag.test.ts b/__TESTS__/unit/actions/Flag.test.ts index 38864e5..e3dfe7a 100644 --- a/__TESTS__/unit/actions/Flag.test.ts +++ b/__TESTS__/unit/actions/Flag.test.ts @@ -1,12 +1,9 @@ import * as Resize from "../../../src/actions/resize"; -import {Flag} from "../../../src/qualifiers/flag"; -import {Transformation} from "../../../src"; +import { Flag } from "../../../src/qualifiers/flag"; +import { Transformation } from "../../../src"; - - - -describe('Tests for Transformation Action -- Flag', () => { - it('Creates a Transformation with image flags', () => { +describe("Tests for Transformation Action -- Flag", () => { + it("Creates a Transformation with image flags", () => { const tx = new Transformation() .addFlag(Flag.anyFormat()) .addFlag(Flag.animatedPng()) @@ -18,51 +15,51 @@ describe('Tests for Transformation Action -- Flag', () => { .addFlag(Flag.png8()) .addFlag(Flag.png24()) .addFlag(Flag.png32()) - .addFlag(Flag.progressive('semi')) + .addFlag(Flag.progressive("semi")) .addFlag(Flag.rasterize()) .addFlag(Flag.sanitize()) .addFlag(Flag.stripProfile()) .addFlag(Flag.tiff8Lzw()) - .addFlag(Flag.attachment('pretty_flower')) + .addFlag(Flag.attachment("pretty_flower")) .addFlag(Flag.getInfo()) .addFlag(Flag.immutableCache()) .addFlag(Flag.keepAttribution()) .addFlag(Flag.keepIptc()) - .addFlag(Flag.custom('myFlag')) + .addFlag(Flag.custom("myFlag")) .addFlag(Flag.layerApply()) .addFlag(Flag.ignoreMaskChannels()) .toString(); const expectedToContain = [ - 'fl_any_format', - 'fl_apng', - 'fl_awebp', - 'fl_clip_evenodd', - 'fl_lossy', - 'fl_clip', - 'fl_preserve_transparency', - 'fl_png8', - 'fl_png24', - 'fl_png32', - 'fl_progressive:semi', - 'fl_rasterize', - 'fl_sanitize', - 'fl_strip_profile', - 'fl_tiff8_lzw', - 'fl_attachment:pretty_flower', - 'fl_getinfo', - 'fl_immutable_cache', - 'fl_keep_attribution', - 'fl_keep_iptc', - 'fl_myFlag', - 'fl_layer_apply', - 'fl_ignore_mask_channels' - ].join('/'); + "fl_any_format", + "fl_apng", + "fl_awebp", + "fl_clip_evenodd", + "fl_lossy", + "fl_clip", + "fl_preserve_transparency", + "fl_png8", + "fl_png24", + "fl_png32", + "fl_progressive:semi", + "fl_rasterize", + "fl_sanitize", + "fl_strip_profile", + "fl_tiff8_lzw", + "fl_attachment:pretty_flower", + "fl_getinfo", + "fl_immutable_cache", + "fl_keep_attribution", + "fl_keep_iptc", + "fl_myFlag", + "fl_layer_apply", + "fl_ignore_mask_channels", + ].join("/"); expect(tx).toBe(`${expectedToContain}`); }); - it('Creates a Transformation with video flags', () => { + it("Creates a Transformation with video flags", () => { const tx = new Transformation() .addFlag(Flag.hlsv3()) .addFlag(Flag.keepDar()) @@ -70,46 +67,36 @@ describe('Tests for Transformation Action -- Flag', () => { .addFlag(Flag.mono()) .addFlag(Flag.splice()) .addFlag(Flag.waveform()) - .addFlag(Flag.streamingAttachment('file_name')) + .addFlag(Flag.streamingAttachment("file_name")) .toString(); const expectedToContain = [ - 'fl_hlsv3', - 'fl_keep_dar', - 'fl_no_stream', - 'fl_mono', - 'fl_splice', - 'fl_waveform', - 'fl_streaming_attachment:file_name' - ].join('/'); + "fl_hlsv3", + "fl_keep_dar", + "fl_no_stream", + "fl_mono", + "fl_splice", + "fl_waveform", + "fl_streaming_attachment:file_name", + ].join("/"); expect(tx).toBe(`${expectedToContain}`); }); - it('Creates a Transformation with multiple flags', () => { + it("Creates a Transformation with multiple flags", () => { const tx = new Transformation() - .resize( - Resize.fill(400) - .aspectRatio(1.0) - .addFlag(Flag.keepIptc()) - .addFlag(Flag.keepAttribution()) - ) + .resize(Resize.fill(400).aspectRatio(1.0).addFlag(Flag.keepIptc()).addFlag(Flag.keepAttribution())) .toString(); - expect(tx).toBe('ar_1.0,c_fill,fl_keep_attribution,fl_keep_iptc,w_400'); + expect(tx).toBe("ar_1.0,c_fill,fl_keep_attribution,fl_keep_iptc,w_400"); }); - it('Can use shortened flag notation', () => { + it("Can use shortened flag notation", () => { const tx = new Transformation() - .resize( - Resize.fill(400) - .aspectRatio(1.0) - .addFlag("keep_iptc") - .addFlag("keep_attribution") - ) + .resize(Resize.fill(400).aspectRatio(1.0).addFlag("keep_iptc").addFlag("keep_attribution")) .toString(); - expect(tx).toBe('ar_1.0,c_fill,fl_keep_attribution,fl_keep_iptc,w_400'); + expect(tx).toBe("ar_1.0,c_fill,fl_keep_attribution,fl_keep_iptc,w_400"); }); }); diff --git a/__TESTS__/unit/actions/NamedTransformation.test.ts b/__TESTS__/unit/actions/NamedTransformation.test.ts index a553796..15af10f 100644 --- a/__TESTS__/unit/actions/NamedTransformation.test.ts +++ b/__TESTS__/unit/actions/NamedTransformation.test.ts @@ -1,30 +1,23 @@ -import {name} from "../../../src/actions/namedTransformation"; -import {scale} from "../../../src/actions/resize"; -import {Transformation} from "../../../src"; +import { name } from "../../../src/actions/namedTransformation"; +import { scale } from "../../../src/actions/resize"; +import { Transformation } from "../../../src"; -describe('Tests for Transformation Action -- NamedTransformation', () => { - it('Ensures NamedTransformation is accepted as an action to ImageTransformation', () => { +describe("Tests for Transformation Action -- NamedTransformation", () => { + it("Ensures NamedTransformation is accepted as an action to ImageTransformation", () => { const tImage = new Transformation(); // Ensures it compiles and doesn't throw - expect( - tImage.namedTransformation(name('foobar')) - ).toEqual(tImage); + expect(tImage.namedTransformation(name("foobar"))).toEqual(tImage); }); - it('Creates a Transformation with name that has an underscore', () => { - const tx = new Transformation() - .namedTransformation(name('_foobar')) - .toString(); + it("Creates a Transformation with name that has an underscore", () => { + const tx = new Transformation().namedTransformation(name("_foobar")).toString(); - expect(tx).toBe('t__foobar'); + expect(tx).toBe("t__foobar"); }); - it('Creates a Transformation with name and resize', () => { - const tx = new Transformation() - .resize(scale(100, 100)) - .namedTransformation(name('foobar')) - .toString(); + it("Creates a Transformation with name and resize", () => { + const tx = new Transformation().resize(scale(100, 100)).namedTransformation(name("foobar")).toString(); - expect(tx).toBe('c_scale,h_100,w_100/t_foobar'); + expect(tx).toBe("c_scale,h_100,w_100/t_foobar"); }); }); diff --git a/__TESTS__/unit/actions/Overlay.test.ts b/__TESTS__/unit/actions/Overlay.test.ts index 4c32d3e..02977ec 100644 --- a/__TESTS__/unit/actions/Overlay.test.ts +++ b/__TESTS__/unit/actions/Overlay.test.ts @@ -1,239 +1,196 @@ -import {BlendMode} from "../../../src/qualifiers/blendMode"; -import {Overlay} from "../../../src/actions/overlay"; -import {Source} from "../../../src/qualifiers/source"; -import {Transformation} from "../../../src"; -import {sampleTxResizePad} from "../../TestUtils/transformations/sampleTxResizePad"; -import {sampleTextStyle} from "../../TestUtils/transformations/sampleTextStyle"; -import {sampleFacePosition} from "../../TestUtils/transformations/sampleFacePosition"; -import {Format, png} from "../../../src/qualifiers/format"; -import {Underlay} from "../../../src/actions/underlay"; -import {Timeline} from "../../../src/qualifiers/timeline"; -import {base64Encode} from "../../../src/internal/utils/base64Encode"; -import {TextStyle} from "../../../src/qualifiers/textStyle"; -import {TextFit} from "../../../src/qualifiers/textFit"; - -describe('Tests for overlay actions', () => { - it('Tests Image on Image with publicID encoding', () => { +import { BlendMode } from "../../../src/qualifiers/blendMode"; +import { Overlay } from "../../../src/actions/overlay"; +import { Source } from "../../../src/qualifiers/source"; +import { Transformation } from "../../../src"; +import { sampleTxResizePad } from "../../TestUtils/transformations/sampleTxResizePad"; +import { sampleTextStyle } from "../../TestUtils/transformations/sampleTextStyle"; +import { sampleFacePosition } from "../../TestUtils/transformations/sampleFacePosition"; +import { Format, png } from "../../../src/qualifiers/format"; +import { Underlay } from "../../../src/actions/underlay"; +import { Timeline } from "../../../src/qualifiers/timeline"; +import { base64Encode } from "../../../src/internal/utils/base64Encode"; +import { TextStyle } from "../../../src/qualifiers/textStyle"; +import { TextFit } from "../../../src/qualifiers/textFit"; + +describe("Tests for overlay actions", () => { + it("Tests Image on Image with publicID encoding", () => { const tx = new Transformation(); - tx.overlay( - Overlay.source(Source.image("path/to/sample") - .format(Format.png()) - ) - ); + tx.overlay(Overlay.source(Source.image("path/to/sample").format(Format.png()))); - expect(tx.toString()).toBe('l_path:to:sample.png/fl_layer_apply'); + expect(tx.toString()).toBe("l_path:to:sample.png/fl_layer_apply"); }); - it('Tests Image on Image with format', () => { + it("Tests Image on Image with format", () => { const tx = new Transformation(); - tx.overlay( - Overlay.source(Source.image("sample") - .format(Format.png()) - ) - ); + tx.overlay(Overlay.source(Source.image("sample").format(Format.png()))); - expect(tx.toString()).toBe('l_sample.png/fl_layer_apply'); + expect(tx.toString()).toBe("l_sample.png/fl_layer_apply"); }); - it('Tests Image on Image with BlendMode and Position', () => { + it("Tests Image on Image with BlendMode and Position", () => { const tx = new Transformation(); - tx.overlay(Overlay.source(Source.image("sample")) - .position(sampleFacePosition()) - .blendMode(BlendMode.screen()) - ); + tx.overlay(Overlay.source(Source.image("sample")).position(sampleFacePosition()).blendMode(BlendMode.screen())); - expect(tx.toString()).toBe('l_sample/e_screen,fl_layer_apply,g_face'); + expect(tx.toString()).toBe("l_sample/e_screen,fl_layer_apply,g_face"); }); - it('Can use shortened BlendMode notation', () => { + it("Can use shortened BlendMode notation", () => { const tx = new Transformation(); - tx.overlay(Overlay.source(Source.image("sample")) - .position(sampleFacePosition()) - .blendMode("mask") - ); + tx.overlay(Overlay.source(Source.image("sample")).position(sampleFacePosition()).blendMode("mask")); - expect(tx.toString()).toBe('l_sample/e_mask,fl_layer_apply,g_face'); + expect(tx.toString()).toBe("l_sample/e_mask,fl_layer_apply,g_face"); }); - it('Tests Image on Image with Transformation', () => { + it("Tests Image on Image with Transformation", () => { const tx = new Transformation(); - tx.overlay( - Overlay.source(Source.image("sample") - .transformation(sampleTxResizePad()) - ) - ); + tx.overlay(Overlay.source(Source.image("sample").transformation(sampleTxResizePad()))); - expect(tx.toString()).toBe('l_sample/c_pad,w_100/fl_layer_apply'); + expect(tx.toString()).toBe("l_sample/c_pad,w_100/fl_layer_apply"); }); - it('Tests Video on Video with Transformation', () => { + it("Tests Video on Video with Transformation", () => { const tx = new Transformation(); - tx.overlay( - Overlay.source(Source.video("sample") - .transformation(sampleTxResizePad()) - ) - ); + tx.overlay(Overlay.source(Source.video("sample").transformation(sampleTxResizePad()))); - expect(tx.toString()).toBe('l_video:sample/c_pad,w_100/fl_layer_apply'); + expect(tx.toString()).toBe("l_video:sample/c_pad,w_100/fl_layer_apply"); }); - it('Tests text on image', () => { + it("Tests text on image", () => { const tx = new Transformation(); const textStyle = sampleTextStyle(); - tx.overlay(Overlay.source( - Source.text('Testing', textStyle) - .backgroundColor('red') - .textColor('blue') - )); + tx.overlay(Overlay.source(Source.text("Testing", textStyle).backgroundColor("red").textColor("blue"))); expect(tx.toString()).toBe(`b_red,co_blue,l_text:${textStyle.toString()}:Testing/fl_layer_apply`); }); - it('Tests text on image using a variable', () => { + it("Tests text on image using a variable", () => { const tx = new Transformation(); - const textStyle = '$My_Variable'; + const textStyle = "$My_Variable"; - tx.overlay(Overlay.source( - Source.text('Testing', textStyle) - .backgroundColor('red') - .textColor('blue') - )); + tx.overlay(Overlay.source(Source.text("Testing", textStyle).backgroundColor("red").textColor("blue"))); expect(tx.toString()).toBe(`b_red,co_blue,l_text:${textStyle.toString()}:Testing/fl_layer_apply`); }); - it('Tests text on image with RGB backgroundColor', () => { + it("Tests text on image with RGB backgroundColor", () => { const tx = new Transformation(); - tx.overlay(Overlay.source( - Source.text('Testing', new TextStyle('arial', 15)) - .backgroundColor('#FEB61FC2') - .textColor('blue') - )); + tx.overlay( + Overlay.source(Source.text("Testing", new TextStyle("arial", 15)).backgroundColor("#FEB61FC2").textColor("blue")) + ); expect(tx.toString()).toBe(`b_rgb:FEB61FC2,co_blue,l_text:arial_15:Testing/fl_layer_apply`); }); - it('Tests nested subtitles on image', () => { + it("Tests nested subtitles on image", () => { const tx = new Transformation(); const textStyle = sampleTextStyle(); - tx.overlay(Overlay.source( - Source.subtitles('path/to/subs.srt').textStyle(textStyle) - )); + tx.overlay(Overlay.source(Source.subtitles("path/to/subs.srt").textStyle(textStyle))); expect(tx.toString()).toBe(`l_subtitles:${textStyle.toString()}:path:to:subs.srt/fl_layer_apply`); }); - it('Tests subtitle on without style', () => { + it("Tests subtitle on without style", () => { const tx = new Transformation(); - tx.overlay(Overlay.source( - Source.subtitles('subs.srt') - )); + tx.overlay(Overlay.source(Source.subtitles("subs.srt"))); expect(tx.toString()).toBe(`l_subtitles:subs.srt/fl_layer_apply`); }); - it('Tests subtitle on image', () => { + it("Tests subtitle on image", () => { const tx = new Transformation(); const textStyle = sampleTextStyle(); - tx.overlay(Overlay.source( - Source.subtitles('subs.srt') - .textStyle(textStyle) - )); + tx.overlay(Overlay.source(Source.subtitles("subs.srt").textStyle(textStyle))); expect(tx.toString()).toBe(`l_subtitles:${textStyle.toString()}:subs.srt/fl_layer_apply`); }); - it('Tests an overlay with a complete example', () => { + it("Tests an overlay with a complete example", () => { const tx = new Transformation(); - tx.overlay(Overlay.source(Source.image("sample").transformation(sampleTxResizePad())) - .position(sampleFacePosition()) - .blendMode(BlendMode.screen()) + tx.overlay( + Overlay.source(Source.image("sample").transformation(sampleTxResizePad())) + .position(sampleFacePosition()) + .blendMode(BlendMode.screen()) ); - expect(tx.toString()).toBe('l_sample/c_pad,w_100/e_screen,fl_layer_apply,g_face'); + expect(tx.toString()).toBe("l_sample/c_pad,w_100/e_screen,fl_layer_apply,g_face"); }); - it('Tests an image underlay with a complete example', () => { + it("Tests an image underlay with a complete example", () => { const tx = new Transformation(); - tx.underlay(Underlay.source(Source.image("sample").transformation(sampleTxResizePad())) - .position(sampleFacePosition()) - .blendMode(BlendMode.screen()) + tx.underlay( + Underlay.source(Source.image("sample").transformation(sampleTxResizePad())) + .position(sampleFacePosition()) + .blendMode(BlendMode.screen()) ); - expect(tx.toString()).toBe('u_sample/c_pad,w_100/e_screen,fl_layer_apply,g_face'); + expect(tx.toString()).toBe("u_sample/c_pad,w_100/e_screen,fl_layer_apply,g_face"); }); - it('Tests a video(main asset) with an image underlay', () => { + it("Tests a video(main asset) with an image underlay", () => { const tx = new Transformation(); - tx.underlay(Underlay.source(Source.image("sample").transformation(sampleTxResizePad())) - .position(sampleFacePosition()) - .blendMode(BlendMode.screen()) + tx.underlay( + Underlay.source(Source.image("sample").transformation(sampleTxResizePad())) + .position(sampleFacePosition()) + .blendMode(BlendMode.screen()) ); // ensure toURL contains video/upload to confirm it's a video - expect(tx.toString()).toContain('u_sample/c_pad,w_100/e_screen,fl_layer_apply,g_face'); + expect(tx.toString()).toContain("u_sample/c_pad,w_100/e_screen,fl_layer_apply,g_face"); }); - it('Video on Video with timeline', () => { + it("Video on Video with timeline", () => { const tx = new Transformation(); - tx.overlay(Overlay.source(Source.video("sample").transformation(sampleTxResizePad())) - .timeline(Timeline.position().startOffset(10).duration(20)) - .position(sampleFacePosition()) + tx.overlay( + Overlay.source(Source.video("sample").transformation(sampleTxResizePad())) + .timeline(Timeline.position().startOffset(10).duration(20)) + .position(sampleFacePosition()) ); - expect(tx.toString()).toBe('l_video:sample/c_pad,w_100/du_20,fl_layer_apply,g_face,so_10'); + expect(tx.toString()).toBe("l_video:sample/c_pad,w_100/du_20,fl_layer_apply,g_face,so_10"); }); - it('Tests a fetchSource without format', () => { + it("Tests a fetchSource without format", () => { const tx = new Transformation(); const REMOTE_URL = "ci"; const BASE64_URL = base64Encode(REMOTE_URL); tx.overlay( - Overlay.source( - Source.fetch(REMOTE_URL) - .transformation(sampleTxResizePad()) - ) - .position(sampleFacePosition()) + Overlay.source(Source.fetch(REMOTE_URL).transformation(sampleTxResizePad())).position(sampleFacePosition()) ); expect(tx.toString()).toContain(`l_fetch:${BASE64_URL}/${sampleTxResizePad().toString()}`); }); - it('Tests a fetchSource with format', () => { + it("Tests a fetchSource with format", () => { const tx = new Transformation(); const REMOTE_URL = "https://res.cloudinary.com/demo/image/upload/ci"; - tx.overlay( - Overlay.source( - Source.fetch(REMOTE_URL) - .transformation(sampleTxResizePad()) - .format(png()) - ) - ); + tx.overlay(Overlay.source(Source.fetch(REMOTE_URL).transformation(sampleTxResizePad()).format(png()))); // This is a fully functional URL that should work in the browser. // Explicitly check the resulting base64 string - expect(tx.toString()).toContain(`l_fetch:aHR0cHM6Ly9yZXMuY2xvdWRpbmFyeS5jb20vZGVtby9pbWFnZS91cGxvYWQvY2k=.png/${sampleTxResizePad().toString()}`); + expect(tx.toString()).toContain( + `l_fetch:aHR0cHM6Ly9yZXMuY2xvdWRpbmFyeS5jb20vZGVtby9pbWFnZS91cGxvYWQvY2k=.png/${sampleTxResizePad().toString()}` + ); }); it("should not serialize a text source with exclamation mark", () => { const tx = new Transformation(); - const text = '!'; - const textSource = Source.text(text, 'arial_15'); + const text = "!"; + const textSource = Source.text(text, "arial_15"); tx.overlay(Overlay.source(textSource)); expect(tx.toString()).toContain("l_text:arial_15:!/fl_layer_apply"); @@ -241,32 +198,32 @@ describe('Tests for overlay actions', () => { it("textFit with alias", () => { const tx = new Transformation(); - const text = 'hello hello hello hello'; - const textSource = Source.text(text, 'arial_15').textFit(TextFit.size(400, 500)); + const text = "hello hello hello hello"; + const textSource = Source.text(text, "arial_15").textFit(TextFit.size(400, 500)); tx.overlay(Overlay.source(textSource)); expect(tx.toString()).toContain("c_fit,w_400,h_500,l_text:arial_15:hello hello hello hello"); }); it("textFit with size", () => { const tx = new Transformation(); - const text = 'hello hello hello hello'; - const textSource = Source.text(text, 'arial_15').textFit(TextFit.size(400)); + const text = "hello hello hello hello"; + const textSource = Source.text(text, "arial_15").textFit(TextFit.size(400)); tx.overlay(Overlay.source(textSource)); expect(tx.toString()).toContain("c_fit,w_400,l_text:arial_15:hello hello hello hello"); }); it("textFit with size and height", () => { const tx = new Transformation(); - const text = 'hello hello hello hello'; - const textSource = Source.text(text, 'arial_15').textFit(TextFit.size(400).height(600)); + const text = "hello hello hello hello"; + const textSource = Source.text(text, "arial_15").textFit(TextFit.size(400).height(600)); tx.overlay(Overlay.source(textSource)); expect(tx.toString()).toContain("c_fit,w_400,h_600,l_text:arial_15:hello hello hello hello"); }); it("should serialize a fetch source", () => { const tx = new Transformation(); - const REMOTE_URL = 'http://res.cloudinary.com/demo/sample.jpg'; - const expected = 'l_fetch:aHR0cDovL3Jlcy5jbG91ZGluYXJ5LmNvbS9kZW1vL3NhbXBsZS5qcGc=/fl_layer_apply'; + const REMOTE_URL = "http://res.cloudinary.com/demo/sample.jpg"; + const expected = "l_fetch:aHR0cDovL3Jlcy5jbG91ZGluYXJ5LmNvbS9kZW1vL3NhbXBsZS5qcGc=/fl_layer_apply"; const actual = tx.overlay(Overlay.source(Source.fetch(REMOTE_URL))).toString(); expect(actual).toBe(expected); @@ -275,7 +232,8 @@ describe('Tests for overlay actions', () => { it("should serialize a unicode url of fetch source", () => { const tx = new Transformation(); const REMOTE_URL = "https://upload.wikimedia.org/wikipedia/commons/2/2b/고창갯벌.jpg"; - const expected = "l_fetch:aHR0cHM6Ly91cGxvYWQud2lraW1lZGlhLm9yZy93aWtpcGVkaWEvY29tbW9ucy8yLzJiLyVFQSVCMyVBMCVFQyVCMCVCRCVFQSVCMCVBRiVFQiVCMiU4Qy5qcGc=/fl_layer_apply"; + const expected = + "l_fetch:aHR0cHM6Ly91cGxvYWQud2lraW1lZGlhLm9yZy93aWtpcGVkaWEvY29tbW9ucy8yLzJiLyVFQSVCMyVBMCVFQyVCMCVCRCVFQSVCMCVBRiVFQiVCMiU4Qy5qcGc=/fl_layer_apply"; const actual = tx.overlay(Overlay.source(Source.fetch(REMOTE_URL))).toString(); expect(actual).toBe(expected); @@ -284,7 +242,7 @@ describe('Tests for overlay actions', () => { it("should support string interpolation", () => { const tx = new Transformation(); const text = "$(start)hello"; - const textSource = Source.text(text, 'arial_15'); + const textSource = Source.text(text, "arial_15"); tx.overlay(Overlay.source(textSource)); expect(tx.toString()).toContain("l_text:arial_15:$(start)hello/fl_layer_apply"); @@ -292,6 +250,6 @@ describe('Tests for overlay actions', () => { it("should throw an exception if fontFamily or fontSize are not provided", () => { expect(() => new TextStyle(null, 17)).toThrow(); - expect(() => new TextStyle('arial', null)).toThrow(); + expect(() => new TextStyle("arial", null)).toThrow(); }); }); diff --git a/__TESTS__/unit/actions/PSDTools.test.ts b/__TESTS__/unit/actions/PSDTools.test.ts index c19baf4..2cb56b6 100644 --- a/__TESTS__/unit/actions/PSDTools.test.ts +++ b/__TESTS__/unit/actions/PSDTools.test.ts @@ -1,89 +1,60 @@ -import {PSDTools} from "../../../src/actions/psdTools"; -import {Transformation} from "../../../src"; +import { PSDTools } from "../../../src/actions/psdTools"; +import { Transformation } from "../../../src"; -describe('Tests for Transformation Action -- PSDTools', () => { - it('Creates a Transformation with clip number', () => { - const tx = new Transformation() - .psdTools(PSDTools.clip().byIndex(9)) - .toString(); +describe("Tests for Transformation Action -- PSDTools", () => { + it("Creates a Transformation with clip number", () => { + const tx = new Transformation().psdTools(PSDTools.clip().byIndex(9)).toString(); - expect(tx).toBe('fl_clip,pg_9'); + expect(tx).toBe("fl_clip,pg_9"); }); - it('Creates a Transformation with clip string', () => { - const tx = new Transformation() - .psdTools(PSDTools.clip().byName('path')) - .toString(); + it("Creates a Transformation with clip string", () => { + const tx = new Transformation().psdTools(PSDTools.clip().byName("path")).toString(); - expect(tx).toBe('fl_clip,pg_name:path'); + expect(tx).toBe("fl_clip,pg_name:path"); }); - it('Creates a Transformation with clip evenOdd', () => { - const tx = new Transformation() - .psdTools(PSDTools.clip().byIndex(9).evenOdd()) - .toString(); + it("Creates a Transformation with clip evenOdd", () => { + const tx = new Transformation().psdTools(PSDTools.clip().byIndex(9).evenOdd()).toString(); - expect(tx).toBe('fl_clip_evenodd,pg_9'); + expect(tx).toBe("fl_clip_evenodd,pg_9"); }); - it('Creates a Transformation with getLayer.byNumber', () => { - const tx = new Transformation() - .psdTools(PSDTools.getLayer().byIndex(4)) - .toString(); + it("Creates a Transformation with getLayer.byNumber", () => { + const tx = new Transformation().psdTools(PSDTools.getLayer().byIndex(4)).toString(); - expect(tx).toBe('pg_4'); + expect(tx).toBe("pg_4"); }); - it('Creates a Transformation with getLayer.byRange', () => { - const tx = new Transformation() - .psdTools(PSDTools.getLayer().byRange(4, 10)) - .toString(); + it("Creates a Transformation with getLayer.byRange", () => { + const tx = new Transformation().psdTools(PSDTools.getLayer().byRange(4, 10)).toString(); - expect(tx).toBe('pg_4-10'); + expect(tx).toBe("pg_4-10"); }); - it('Creates a Transformation with getLayer.byName', () => { - const tx = new Transformation() - .psdTools(PSDTools.getLayer().byName('sample')) - .toString(); + it("Creates a Transformation with getLayer.byName", () => { + const tx = new Transformation().psdTools(PSDTools.getLayer().byName("sample")).toString(); - expect(tx).toBe('pg_name:sample'); + expect(tx).toBe("pg_name:sample"); }); - it('Creates a Transformation with smartObject.byIndex', () => { - const tx = new Transformation() - .psdTools(PSDTools.smartObject().byIndex(8).byIndex(5)) - .toString(); + it("Creates a Transformation with smartObject.byIndex", () => { + const tx = new Transformation().psdTools(PSDTools.smartObject().byIndex(8).byIndex(5)).toString(); - expect(tx).toBe('pg_embedded:8;5'); + expect(tx).toBe("pg_embedded:8;5"); }); - it('Creates a Transformation with smartObject.byLayerName', () => { + it("Creates a Transformation with smartObject.byLayerName", () => { const tx = new Transformation() - .psdTools(PSDTools.smartObject().byLayerName('myLayer').byLayerName('myLayer2')) + .psdTools(PSDTools.smartObject().byLayerName("myLayer").byLayerName("myLayer2")) .toString(); - expect(tx).toBe('pg_embedded:name:myLayer;myLayer2'); + expect(tx).toBe("pg_embedded:name:myLayer;myLayer2"); }); - it('Uses multiple qualifiers', () => { - expect(PSDTools - .getLayer() - .byIndex(1) - .byRange(5, 7) - .toString() - ).toBe('pg_1;5-7'); // pg_1;5-7 - expect(PSDTools - .getLayer() - .byRange(4, 7) - .byIndex(9) - .toString() - ).toBe('pg_4-7;9'); - expect(PSDTools - .getLayer() - .byName("lala") - .byName('fofo') - .toString() - ).toBe('pg_name:lala;fofo'); + it("Uses multiple qualifiers", () => { + expect(PSDTools.getLayer().byIndex(1).byRange(5, 7).toString()).toBe("pg_1;5-7"); // pg_1;5-7 + expect(PSDTools.getLayer().byRange(4, 7).byIndex(9).toString()).toBe("pg_4-7;9"); + expect(PSDTools.getLayer().byName("lala").byName("fofo").toString()).toBe("pg_name:lala;fofo"); }); }); diff --git a/__TESTS__/unit/actions/Pixelate/Pixelate.test.ts b/__TESTS__/unit/actions/Pixelate/Pixelate.test.ts index 360c55e..4cd47c9 100644 --- a/__TESTS__/unit/actions/Pixelate/Pixelate.test.ts +++ b/__TESTS__/unit/actions/Pixelate/Pixelate.test.ts @@ -1,45 +1,24 @@ -import {Region} from "../../../../src/qualifiers/region"; -import {Effect} from "../../../../src/actions/effect"; +import { Region } from "../../../../src/qualifiers/region"; +import { Effect } from "../../../../src/actions/effect"; -describe('Tests for Transformation Action -- Pixelate', () => { - it('Tests pixelate with and without squareSize', () => { - expect(Effect.pixelate() - .toString() - ).toEqual('e_pixelate'); +describe("Tests for Transformation Action -- Pixelate", () => { + it("Tests pixelate with and without squareSize", () => { + expect(Effect.pixelate().toString()).toEqual("e_pixelate"); - expect(Effect.pixelate() - .squareSize(10) - .toString() - ).toEqual('e_pixelate:10'); + expect(Effect.pixelate().squareSize(10).toString()).toEqual("e_pixelate:10"); }); - it('Test pixelate:faces', () => { - expect(Effect.pixelate() - .squareSize(50) - .region(Region.faces()).toString()).toBe('e_pixelate_faces:50'); + it("Test pixelate:faces", () => { + expect(Effect.pixelate().squareSize(50).region(Region.faces()).toString()).toBe("e_pixelate_faces:50"); }); - it('Test pixelate custom region', () => { - expect(Effect.pixelate() - .squareSize(10) - .region(Region.custom() - .height(20) - .width(30) - .x(40) - .y(50) - ) - .toString() - ) - .toEqual('e_pixelate_region:10,h_20,w_30,x_40,y_50'); + it("Test pixelate custom region", () => { + expect( + Effect.pixelate().squareSize(10).region(Region.custom().height(20).width(30).x(40).y(50)).toString() + ).toEqual("e_pixelate_region:10,h_20,w_30,x_40,y_50"); }); - it('Test pixelate with Region.ocr', () => { - expect(Effect.pixelate() - .squareSize(10) - .region(Region.ocr() - ) - .toString() - ) - .toEqual('e_pixelate_region:10,g_ocr_text'); + it("Test pixelate with Region.ocr", () => { + expect(Effect.pixelate().squareSize(10).region(Region.ocr()).toString()).toEqual("e_pixelate_region:10,g_ocr_text"); }); }); diff --git a/__TESTS__/unit/actions/Quality.test.ts b/__TESTS__/unit/actions/Quality.test.ts index bdb699b..8f0f417 100644 --- a/__TESTS__/unit/actions/Quality.test.ts +++ b/__TESTS__/unit/actions/Quality.test.ts @@ -1,95 +1,74 @@ -import {ChromaSubSampling} from "../../../src/qualifiers/chromaSubSampling"; -import {Quality} from "../../../src/qualifiers/quality"; -import {Delivery} from "../../../src/actions/delivery"; -import {Transformation} from "../../../src"; +import { ChromaSubSampling } from "../../../src/qualifiers/chromaSubSampling"; +import { Quality } from "../../../src/qualifiers/quality"; +import { Delivery } from "../../../src/actions/delivery"; +import { Transformation } from "../../../src"; +describe("Tests for Transformation Action -- Delivery.quality", () => { + it("Creates a Transformation with quality", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.auto())).toString(); -describe('Tests for Transformation Action -- Delivery.quality', () => { - it('Creates a Transformation with quality', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.auto())) - .toString(); - - expect(tx).toBe('q_auto'); + expect(tx).toBe("q_auto"); }); - it('Creates a Transformation with quality:best', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.autoBest())) - .toString(); + it("Creates a Transformation with quality:best", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.autoBest())).toString(); - expect(tx).toBe('q_auto:best'); + expect(tx).toBe("q_auto:best"); }); - it('Creates a Transformation with quality:eco', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.autoEco())) - .toString(); + it("Creates a Transformation with quality:eco", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.autoEco())).toString(); - expect(tx).toBe('q_auto:eco'); + expect(tx).toBe("q_auto:eco"); }); - it('Creates a Transformation with quality:good', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.autoGood())) - .toString(); + it("Creates a Transformation with quality:good", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.autoGood())).toString(); - expect(tx).toBe('q_auto:good'); + expect(tx).toBe("q_auto:good"); }); - it('Creates a Transformation with quality:low', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.autoLow())) - .toString(); + it("Creates a Transformation with quality:low", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.autoLow())).toString(); - expect(tx).toBe('q_auto:low'); + expect(tx).toBe("q_auto:low"); }); - it('Creates a Transformation with jpegmini', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.jpegmini())) - .toString(); + it("Creates a Transformation with jpegmini", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.jpegmini())).toString(); - expect(tx).toBe('q_jpegmini'); + expect(tx).toBe("q_jpegmini"); }); - it('Creates a Transformation with jpegmini HIGH', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.jpegminiHigh())) - .toString(); + it("Creates a Transformation with jpegmini HIGH", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.jpegminiHigh())).toString(); - expect(tx).toBe('q_jpegmini:1'); + expect(tx).toBe("q_jpegmini:1"); }); - it('Creates a Transformation with jpegmini MEDIUM', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.jpegminiMedium())) - .toString(); + it("Creates a Transformation with jpegmini MEDIUM", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.jpegminiMedium())).toString(); - expect(tx).toBe('q_jpegmini:2'); + expect(tx).toBe("q_jpegmini:2"); }); - it('Creates a Transformation with jpegmini BEST', () => { - const tx = new Transformation() - .delivery(Delivery.quality(Quality.jpegminiBest())) - .toString(); + it("Creates a Transformation with jpegmini BEST", () => { + const tx = new Transformation().delivery(Delivery.quality(Quality.jpegminiBest())).toString(); - expect(tx).toBe('q_jpegmini:0'); + expect(tx).toBe("q_jpegmini:0"); }); - it('Creates a Transformation with level', () => { + it("Creates a Transformation with level", () => { const tx = new Transformation() - .delivery(Delivery.quality('75').chromaSubSampling(ChromaSubSampling.chroma420())) + .delivery(Delivery.quality("75").chromaSubSampling(ChromaSubSampling.chroma420())) .toString(); - expect(tx).toBe('q_75:420'); + expect(tx).toBe("q_75:420"); }); - it('Sets Quanitzation level', () => { - const tx = new Transformation() - .delivery(Delivery.quality('75').quantization(123)) - .toString(); + it("Sets Quanitzation level", () => { + const tx = new Transformation().delivery(Delivery.quality("75").quantization(123)).toString(); - expect(tx).toBe('q_75:qmax_123'); + expect(tx).toBe("q_75:qmax_123"); }); }); diff --git a/__TESTS__/unit/actions/Reshape.test.ts b/__TESTS__/unit/actions/Reshape.test.ts index 14abd94..472e225 100644 --- a/__TESTS__/unit/actions/Reshape.test.ts +++ b/__TESTS__/unit/actions/Reshape.test.ts @@ -1,82 +1,61 @@ -import {image} from "../../../src/qualifiers/source"; -import {scale} from "../../../src/actions/resize"; -import {Reshape} from "../../../src/actions/reshape"; -import {Position} from "../../../src/qualifiers/position"; -import {Gravity} from "../../../src/qualifiers/gravity"; -import {Compass} from "../../../src/qualifiers/compass"; -import {Transformation} from "../../../src"; - - - - -describe('Tests for Transformation Action -- Cutter', () => { - it('Creates a reshape.cutByImage (cutter)overlay', () => { +import { image } from "../../../src/qualifiers/source"; +import { scale } from "../../../src/actions/resize"; +import { Reshape } from "../../../src/actions/reshape"; +import { Position } from "../../../src/qualifiers/position"; +import { Gravity } from "../../../src/qualifiers/gravity"; +import { Compass } from "../../../src/qualifiers/compass"; +import { Transformation } from "../../../src"; + +describe("Tests for Transformation Action -- Cutter", () => { + it("Creates a reshape.cutByImage (cutter)overlay", () => { const tx = new Transformation() - .reshape(Reshape.cutByImage(image('sourceImage').transformation( - new Transformation().resize(scale().width(100)) - ))) + .reshape(Reshape.cutByImage(image("sourceImage").transformation(new Transformation().resize(scale().width(100))))) .toString(); - expect(tx).toContain('l_sourceImage/c_scale,w_100/fl_cutter,fl_layer_apply'); + expect(tx).toContain("l_sourceImage/c_scale,w_100/fl_cutter,fl_layer_apply"); }); - it('Creates a reshape.cutByImage (cutter)overlay with position g_center', () => { + it("Creates a reshape.cutByImage (cutter)overlay with position g_center", () => { const tx = new Transformation() .reshape( - Reshape.cutByImage( - image('sourceImage')) - .position( - new Position().gravity(Gravity.compass(Compass.center())) - ) + Reshape.cutByImage(image("sourceImage")).position(new Position().gravity(Gravity.compass(Compass.center()))) ) .toString(); - expect(tx).toContain('l_sourceImage/fl_cutter,fl_layer_apply,g_center'); + expect(tx).toContain("l_sourceImage/fl_cutter,fl_layer_apply,g_center"); }); - it('Creates a reshape.cutByImage (cutter)overlay with position g_north', () => { + it("Creates a reshape.cutByImage (cutter)overlay with position g_north", () => { const tx = new Transformation() .reshape( - Reshape.cutByImage( - image('sourceImage')) - .position( - new Position().gravity(Gravity.compass(Compass.north())) - ) + Reshape.cutByImage(image("sourceImage")).position(new Position().gravity(Gravity.compass(Compass.north()))) ) .toString(); - expect(tx).toContain('l_sourceImage/fl_cutter,fl_layer_apply,g_north'); + expect(tx).toContain("l_sourceImage/fl_cutter,fl_layer_apply,g_north"); }); - it('Distorts an image with an arc', () => { - const tx = new Transformation() - .reshape(Reshape.distortArc(200)) - .toString(); + it("Distorts an image with an arc", () => { + const tx = new Transformation().reshape(Reshape.distortArc(200)).toString(); - expect(tx).toBe('e_distort:arc:200'); + expect(tx).toBe("e_distort:arc:200"); }); - it('Shears an image with constructor arguments', () => { - const tx = new Transformation() - .reshape(Reshape.shear(100, 200)) - .toString(); + it("Shears an image with constructor arguments", () => { + const tx = new Transformation().reshape(Reshape.shear(100, 200)).toString(); - expect(tx).toBe('e_shear:100:200'); + expect(tx).toBe("e_shear:100:200"); }); - it('Distorts an image with coordinates', () => { - const tx = new Transformation() - .reshape(Reshape.distort([1, 2, 3, 4, 5, 6, 7, 8])) - .toString(); + it("Distorts an image with coordinates", () => { + const tx = new Transformation().reshape(Reshape.distort([1, 2, 3, 4, 5, 6, 7, 8])).toString(); - expect(tx).toBe('e_distort:1:2:3:4:5:6:7:8'); + expect(tx).toBe("e_distort:1:2:3:4:5:6:7:8"); }); - it('Trims an image', () => { - const tx = new Transformation() - .reshape(Reshape.trim().colorOverride('blue').colorSimilarity(15)) - .toString(); + it("Trims an image", () => { + const tx = new Transformation().reshape(Reshape.trim().colorOverride("blue").colorSimilarity(15)).toString(); - expect(tx).toBe('e_trim:15:blue'); + expect(tx).toBe("e_trim:15:blue"); }); }); diff --git a/__TESTS__/unit/actions/Resize.test.ts b/__TESTS__/unit/actions/Resize.test.ts index e497cc6..58e234b 100644 --- a/__TESTS__/unit/actions/Resize.test.ts +++ b/__TESTS__/unit/actions/Resize.test.ts @@ -1,29 +1,25 @@ import * as Resize from "../../../src/actions/resize.js"; -import {Expression} from "../../../src/qualifiers/expression.js"; -import {Transformation} from "../../../src"; +import { Expression } from "../../../src/qualifiers/expression.js"; +import { Transformation } from "../../../src"; -describe('Tests for Transformation Action -- Resize', () => { - it('Resize with a resize mode - relative', () => { - const tx = new Transformation() - .resize(Resize.scale(100).relative()).toString(); - expect(tx).toContain('c_scale,fl_relative,w_100'); +describe("Tests for Transformation Action -- Resize", () => { + it("Resize with a resize mode - relative", () => { + const tx = new Transformation().resize(Resize.scale(100).relative()).toString(); + expect(tx).toContain("c_scale,fl_relative,w_100"); }); - it('Resize with a resize mode - region_relative', () => { - const tx = new Transformation() - .resize(Resize.scale(100).regionRelative()).toString(); - expect(tx).toContain('c_scale,fl_region_relative,w_100'); + it("Resize with a resize mode - region_relative", () => { + const tx = new Transformation().resize(Resize.scale(100).regionRelative()).toString(); + expect(tx).toContain("c_scale,fl_region_relative,w_100"); }); - it('Resize with an expression', () => { - const tx = new Transformation() - .resize(Resize.scale().width(Expression.expression('100 + 5'))).toString(); - expect(tx).toContain('c_scale,w_100_add_5'); + it("Resize with an expression", () => { + const tx = new Transformation().resize(Resize.scale().width(Expression.expression("100 + 5"))).toString(); + expect(tx).toContain("c_scale,w_100_add_5"); }); - it('Resize with gravity', () => { - const tx = new Transformation() - .resize(Resize.pad().width(100).gravity('west')).toString(); - expect(tx).toContain('c_pad,g_west,w_100'); + it("Resize with gravity", () => { + const tx = new Transformation().resize(Resize.pad().width(100).gravity("west")).toString(); + expect(tx).toContain("c_pad,g_west,w_100"); }); }); diff --git a/__TESTS__/unit/actions/Resize/AspectRatio.test.ts b/__TESTS__/unit/actions/Resize/AspectRatio.test.ts index 15e65b3..21480a9 100644 --- a/__TESTS__/unit/actions/Resize/AspectRatio.test.ts +++ b/__TESTS__/unit/actions/Resize/AspectRatio.test.ts @@ -1,41 +1,26 @@ -import {AspectRatio} from "../../../../src/qualifiers/aspectRatio"; -import {crop} from "../../../../src/actions/resize"; -import {Transformation} from "../../../../src"; +import { AspectRatio } from "../../../../src/qualifiers/aspectRatio"; +import { crop } from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; -describe('Tests for AspectRatio values Action -- Resize.crop', () => { - it('Generates transformation using AspectRatio options', () => { +describe("Tests for AspectRatio values Action -- Resize.crop", () => { + it("Generates transformation using AspectRatio options", () => { const tx = new Transformation() - .resize( - crop().aspectRatio(AspectRatio.ar1X1()) - ) - .resize( - crop().aspectRatio(AspectRatio.ar16X9()) - ) - .resize( - crop().aspectRatio(AspectRatio.ar4X3()) - ) - .resize( - crop().aspectRatio(AspectRatio.ar3X2()) - ) - .resize( - crop().aspectRatio(AspectRatio.ar3X1()) - ) - .resize( - crop().aspectRatio(AspectRatio.ar5X4()) - ) - .resize( - crop().aspectRatio(AspectRatio.ignoreInitialAspectRatio()) - ) + .resize(crop().aspectRatio(AspectRatio.ar1X1())) + .resize(crop().aspectRatio(AspectRatio.ar16X9())) + .resize(crop().aspectRatio(AspectRatio.ar4X3())) + .resize(crop().aspectRatio(AspectRatio.ar3X2())) + .resize(crop().aspectRatio(AspectRatio.ar3X1())) + .resize(crop().aspectRatio(AspectRatio.ar5X4())) + .resize(crop().aspectRatio(AspectRatio.ignoreInitialAspectRatio())) .toString(); - expect(tx).toContain('ar_1:1,c_crop/ar_16:9,c_crop/ar_4:3,c_crop/ar_3:2,c_crop/ar_3:1,c_crop/ar_5:4,c_crop/c_crop,fl_ignore_aspect_ratio'); + expect(tx).toContain( + "ar_1:1,c_crop/ar_16:9,c_crop/ar_4:3,c_crop/ar_3:2,c_crop/ar_3:1,c_crop/ar_5:4,c_crop/c_crop,fl_ignore_aspect_ratio" + ); }); - it('Can use shortened aspectRatio notation', () => { - const tx = new Transformation() - .resize( - crop().aspectRatio("3:2")) - .toString(); + it("Can use shortened aspectRatio notation", () => { + const tx = new Transformation().resize(crop().aspectRatio("3:2")).toString(); - expect(tx).toContain('ar_3:2,c_crop'); + expect(tx).toContain("ar_3:2,c_crop"); }); }); diff --git a/__TESTS__/unit/actions/Resize/CropAction.test.ts b/__TESTS__/unit/actions/Resize/CropAction.test.ts index 5852531..2a116e6 100644 --- a/__TESTS__/unit/actions/Resize/CropAction.test.ts +++ b/__TESTS__/unit/actions/Resize/CropAction.test.ts @@ -1,49 +1,33 @@ import * as Gravity from "../../../../src/qualifiers/gravity"; -import {crop} from "../../../../src/actions/resize"; -import {face} from "../../../../src/qualifiers/focusOn"; -import {Transformation} from "../../../../src"; +import { crop } from "../../../../src/actions/resize"; +import { face } from "../../../../src/qualifiers/focusOn"; +import { Transformation } from "../../../../src"; - -describe('Tests for Transformation Action -- Resize.crop', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.crop", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(crop(250, 250)).toString(); - expect(tx).toContain('c_crop,h_250,w_250'); + expect(tx).toContain("c_crop,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - crop() - .width(250) - .height(250) - .x(10) - .y(10) - .gravity(Gravity.autoGravity()) - .aspectRatio(1.2) - .relative()).toString(); - expect(tx).toContain('ar_1.2,c_crop,fl_relative,g_auto,h_250,w_250,x_10,y_10'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize(crop().width(250).height(250).x(10).y(10).gravity(Gravity.autoGravity()).aspectRatio(1.2).relative()) + .toString(); + expect(tx).toContain("ar_1.2,c_crop,fl_relative,g_auto,h_250,w_250,x_10,y_10"); }); - it('Ensures it generates the right transformation using qualifiers (With region relative', () => { - const tx = new Transformation().resize( - crop() - .regionRelative()).toString(); - expect(tx).toContain('fl_region_relative'); + it("Ensures it generates the right transformation using qualifiers (With region relative", () => { + const tx = new Transformation().resize(crop().regionRelative()).toString(); + expect(tx).toContain("fl_region_relative"); }); - it('Uses xyCenter as a gravity type', () => { - const tx = new Transformation().resize( - crop() - .gravity(Gravity.xyCenter()) - .x(100) - .y(100)).toString(); - expect(tx).toContain('g_xy_center,x_100,y_100'); + it("Uses xyCenter as a gravity type", () => { + const tx = new Transformation().resize(crop().gravity(Gravity.xyCenter()).x(100).y(100)).toString(); + expect(tx).toContain("g_xy_center,x_100,y_100"); }); - it('Uses zoom on crop', () => { - const tx = new Transformation().resize( - crop() - .gravity(Gravity.focusOn(face())) - .zoom(1.3)).toString(); - expect(tx).toContain('c_crop,g_face,z_1.3'); + it("Uses zoom on crop", () => { + const tx = new Transformation().resize(crop().gravity(Gravity.focusOn(face())).zoom(1.3)).toString(); + expect(tx).toContain("c_crop,g_face,z_1.3"); }); }); diff --git a/__TESTS__/unit/actions/Resize/FillAction.test.ts b/__TESTS__/unit/actions/Resize/FillAction.test.ts index e32ac65..e0955ca 100644 --- a/__TESTS__/unit/actions/Resize/FillAction.test.ts +++ b/__TESTS__/unit/actions/Resize/FillAction.test.ts @@ -1,33 +1,24 @@ import * as Gravity from "../../../../src/qualifiers/gravity"; -import {fill} from "../../../../src/actions/resize"; -import {Transformation} from "../../../../src"; +import { fill } from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; - -describe('Tests for Transformation Action -- Resize.fill', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.fill", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(fill(250, 250)).toString(); - expect(tx).toContain('c_fill,h_250,w_250'); + expect(tx).toContain("c_fill,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - fill() - .width(250) - .height(250) - .gravity(Gravity.autoGravity()) - .aspectRatio(1.2)).toString(); - expect(tx).toContain('ar_1.2,c_fill,g_auto,h_250,w_250'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize(fill().width(250).height(250).gravity(Gravity.autoGravity()).aspectRatio(1.2)) + .toString(); + expect(tx).toContain("ar_1.2,c_fill,g_auto,h_250,w_250"); }); - it('Ensures it generates the right transformation xyCenter and x,y', () => { - const tx = new Transformation().resize( - fill() - .width(250) - .height(250) - .gravity(Gravity.xyCenter()) - .x(100) - .y(100) - .aspectRatio(1.2)).toString(); - expect(tx).toContain('ar_1.2,c_fill,g_xy_center,h_250,w_250,x_100,y_100'); + it("Ensures it generates the right transformation xyCenter and x,y", () => { + const tx = new Transformation() + .resize(fill().width(250).height(250).gravity(Gravity.xyCenter()).x(100).y(100).aspectRatio(1.2)) + .toString(); + expect(tx).toContain("ar_1.2,c_fill,g_xy_center,h_250,w_250,x_100,y_100"); }); }); diff --git a/__TESTS__/unit/actions/Resize/FillPadAction.test.ts b/__TESTS__/unit/actions/Resize/FillPadAction.test.ts index f106fd6..3d020c9 100644 --- a/__TESTS__/unit/actions/Resize/FillPadAction.test.ts +++ b/__TESTS__/unit/actions/Resize/FillPadAction.test.ts @@ -1,25 +1,27 @@ -import {Transformation} from "../../../../src"; -import {Gravity} from "../../../../src/qualifiers/gravity"; -import {Background} from "../../../../src/qualifiers/background"; -import {fillPad} from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; +import { Gravity } from "../../../../src/qualifiers/gravity"; +import { Background } from "../../../../src/qualifiers/background"; +import { fillPad } from "../../../../src/actions/resize"; - -describe('Tests for Transformation Action -- Resize.fillPad', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.fillPad", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(fillPad(250, 250)).toString(); - expect(tx).toContain('c_fill_pad,h_250,w_250'); + expect(tx).toContain("c_fill_pad,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - fillPad() - .width(250) - .height(250) - .offsetX(10) - .offsetY(10) - .gravity(Gravity.autoGravity()) - .aspectRatio(1.2) - .background(Background.color('red'))).toString(); - expect(tx).toContain('ar_1.2,b_red,c_fill_pad,g_auto,h_250,w_250,x_10,y_10'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize( + fillPad() + .width(250) + .height(250) + .offsetX(10) + .offsetY(10) + .gravity(Gravity.autoGravity()) + .aspectRatio(1.2) + .background(Background.color("red")) + ) + .toString(); + expect(tx).toContain("ar_1.2,b_red,c_fill_pad,g_auto,h_250,w_250,x_10,y_10"); }); }); diff --git a/__TESTS__/unit/actions/Resize/FitAction.test.ts b/__TESTS__/unit/actions/Resize/FitAction.test.ts index 7c85168..62a9f97 100644 --- a/__TESTS__/unit/actions/Resize/FitAction.test.ts +++ b/__TESTS__/unit/actions/Resize/FitAction.test.ts @@ -1,19 +1,14 @@ -import {Transformation} from "../../../../src"; -import {fit} from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; +import { fit } from "../../../../src/actions/resize"; -describe('Tests for Transformation Action -- Resize.fill', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.fill", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(fit(250, 250)).toString(); - expect(tx).toContain('c_fit,h_250,w_250'); + expect(tx).toContain("c_fit,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - fit() - .width(250) - .height(250) - .aspectRatio(1.2) - .relative()).toString(); - expect(tx).toContain('ar_1.2,c_fit,fl_relative,h_250,w_250'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation().resize(fit().width(250).height(250).aspectRatio(1.2).relative()).toString(); + expect(tx).toContain("ar_1.2,c_fit,fl_relative,h_250,w_250"); }); }); diff --git a/__TESTS__/unit/actions/Resize/ImaggaCropAction.test.ts b/__TESTS__/unit/actions/Resize/ImaggaCropAction.test.ts index 611b347..9db55d9 100644 --- a/__TESTS__/unit/actions/Resize/ImaggaCropAction.test.ts +++ b/__TESTS__/unit/actions/Resize/ImaggaCropAction.test.ts @@ -1,20 +1,14 @@ -import {Transformation} from "../../../../src"; -import {imaggaCrop} from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; +import { imaggaCrop } from "../../../../src/actions/resize"; - -describe('Tests for Transformation Action -- Resize.imaggaCrop', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.imaggaCrop", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(imaggaCrop(250, 250)).toString(); - expect(tx).toContain('c_imagga_crop,h_250,w_250'); + expect(tx).toContain("c_imagga_crop,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - imaggaCrop() - .width(250) - .height(250) - .aspectRatio(1.2) - .relative()).toString(); - expect(tx).toContain('ar_1.2,c_imagga_crop,fl_relative,h_250,w_250'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation().resize(imaggaCrop().width(250).height(250).aspectRatio(1.2).relative()).toString(); + expect(tx).toContain("ar_1.2,c_imagga_crop,fl_relative,h_250,w_250"); }); -}); \ No newline at end of file +}); diff --git a/__TESTS__/unit/actions/Resize/ImaggaScaleAction.test.ts b/__TESTS__/unit/actions/Resize/ImaggaScaleAction.test.ts index 56bb951..e0a6aab 100644 --- a/__TESTS__/unit/actions/Resize/ImaggaScaleAction.test.ts +++ b/__TESTS__/unit/actions/Resize/ImaggaScaleAction.test.ts @@ -1,19 +1,14 @@ -import {Transformation} from "../../../../src"; -import {imaggaScale} from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; +import { imaggaScale } from "../../../../src/actions/resize"; - -describe('Tests for Transformation Action -- Resize.imaggaScale', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.imaggaScale", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(imaggaScale(250, 250)).toString(); - expect(tx).toContain('c_imagga_scale,h_250,w_250'); + expect(tx).toContain("c_imagga_scale,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - imaggaScale() - .width(250) - .height(250) - .aspectRatio(2)).toString(); - expect(tx).toContain('ar_2.0,c_imagga_scale,h_250,w_250'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation().resize(imaggaScale().width(250).height(250).aspectRatio(2)).toString(); + expect(tx).toContain("ar_2.0,c_imagga_scale,h_250,w_250"); }); }); diff --git a/__TESTS__/unit/actions/Resize/LimitFillAction.test.ts b/__TESTS__/unit/actions/Resize/LimitFillAction.test.ts index 8c42f9d..c422e1e 100644 --- a/__TESTS__/unit/actions/Resize/LimitFillAction.test.ts +++ b/__TESTS__/unit/actions/Resize/LimitFillAction.test.ts @@ -1,33 +1,24 @@ -import {Transformation} from "../../../../src"; -import {limitFill} from "../../../../src/actions/resize"; -import {Gravity} from "../../../../src/qualifiers/gravity"; +import { Transformation } from "../../../../src"; +import { limitFill } from "../../../../src/actions/resize"; +import { Gravity } from "../../../../src/qualifiers/gravity"; - -describe('Tests for Transformation Action -- Resize.limitFill', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.limitFill", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(limitFill(250, 250)).toString(); - expect(tx).toContain('c_lfill,h_250,w_250'); + expect(tx).toContain("c_lfill,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - limitFill() - .width(250) - .height(250) - .gravity(Gravity.autoGravity()) - .aspectRatio(1.2)).toString(); - expect(tx).toContain('ar_1.2,c_lfill,g_auto,h_250,w_250'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize(limitFill().width(250).height(250).gravity(Gravity.autoGravity()).aspectRatio(1.2)) + .toString(); + expect(tx).toContain("ar_1.2,c_lfill,g_auto,h_250,w_250"); }); - it('Ensures it generates the right transformation using xyGravity and x,y', () => { - const tx = new Transformation().resize( - limitFill() - .width(250) - .height(250) - .x(100) - .y(100) - .gravity(Gravity.xyCenter()) - .aspectRatio(1.2)).toString(); - expect(tx).toContain('ar_1.2,c_lfill,g_xy_center,h_250,w_250,x_100,y_100'); + it("Ensures it generates the right transformation using xyGravity and x,y", () => { + const tx = new Transformation() + .resize(limitFill().width(250).height(250).x(100).y(100).gravity(Gravity.xyCenter()).aspectRatio(1.2)) + .toString(); + expect(tx).toContain("ar_1.2,c_lfill,g_xy_center,h_250,w_250,x_100,y_100"); }); }); diff --git a/__TESTS__/unit/actions/Resize/LimitFitAction.test.ts b/__TESTS__/unit/actions/Resize/LimitFitAction.test.ts index 7603092..a4744c3 100644 --- a/__TESTS__/unit/actions/Resize/LimitFitAction.test.ts +++ b/__TESTS__/unit/actions/Resize/LimitFitAction.test.ts @@ -1,17 +1,14 @@ -import {Transformation} from "../../../../src"; -import {limitFit} from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; +import { limitFit } from "../../../../src/actions/resize"; -describe('Tests for Transformation Action -- Resize.limitFit', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.limitFit", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(limitFit(250, 250)).toString(); - expect(tx).toContain('c_limit,h_250,w_250'); + expect(tx).toContain("c_limit,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - limitFit() - .width(250) - .height(250)).toString(); - expect(tx).toContain('c_limit,h_250,w_250'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation().resize(limitFit().width(250).height(250)).toString(); + expect(tx).toContain("c_limit,h_250,w_250"); }); }); diff --git a/__TESTS__/unit/actions/Resize/LimitPadAction.test.ts b/__TESTS__/unit/actions/Resize/LimitPadAction.test.ts index 8571cb6..a407261 100644 --- a/__TESTS__/unit/actions/Resize/LimitPadAction.test.ts +++ b/__TESTS__/unit/actions/Resize/LimitPadAction.test.ts @@ -1,25 +1,28 @@ -import {Transformation} from "../../../../src"; -import {limitPad} from "../../../../src/actions/resize"; -import {Background} from "../../../../src/qualifiers/background"; -import {Gravity} from "../../../../src/qualifiers/gravity"; -import {Compass} from "../../../../src/qualifiers/compass"; +import { Transformation } from "../../../../src"; +import { limitPad } from "../../../../src/actions/resize"; +import { Background } from "../../../../src/qualifiers/background"; +import { Gravity } from "../../../../src/qualifiers/gravity"; +import { Compass } from "../../../../src/qualifiers/compass"; -describe('Tests for Transformation Action -- Resize.limitPad', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.limitPad", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(limitPad(250, 250)).toString(); - expect(tx).toContain('c_lpad,h_250,w_250'); + expect(tx).toContain("c_lpad,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - limitPad() - .width(250) - .height(250) - .aspectRatio(2) - .offsetX(10) - .offsetY(10) - .gravity(Gravity.compass(Compass.west())) - .background(Background.color('red'))).toString(); - expect(tx).toContain('ar_2.0,b_red,c_lpad,g_west,h_250,w_250,x_10,y_10'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize( + limitPad() + .width(250) + .height(250) + .aspectRatio(2) + .offsetX(10) + .offsetY(10) + .gravity(Gravity.compass(Compass.west())) + .background(Background.color("red")) + ) + .toString(); + expect(tx).toContain("ar_2.0,b_red,c_lpad,g_west,h_250,w_250,x_10,y_10"); }); }); diff --git a/__TESTS__/unit/actions/Resize/MinimumFitAction.test.ts b/__TESTS__/unit/actions/Resize/MinimumFitAction.test.ts index 5b92676..770e132 100644 --- a/__TESTS__/unit/actions/Resize/MinimumFitAction.test.ts +++ b/__TESTS__/unit/actions/Resize/MinimumFitAction.test.ts @@ -1,17 +1,14 @@ -import {Transformation} from "../../../../src"; -import {minimumFit} from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; +import { minimumFit } from "../../../../src/actions/resize"; -describe('Tests for Transformation Action -- Resize.minimumFit', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.minimumFit", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(minimumFit(250, 250)).toString(); - expect(tx).toContain('c_mfit,h_250,w_250'); + expect(tx).toContain("c_mfit,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - minimumFit() - .width(250) - .height(250)).toString(); - expect(tx).toContain('c_mfit,h_250,w_250'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation().resize(minimumFit().width(250).height(250)).toString(); + expect(tx).toContain("c_mfit,h_250,w_250"); }); }); diff --git a/__TESTS__/unit/actions/Resize/MinimumPadAction.test.ts b/__TESTS__/unit/actions/Resize/MinimumPadAction.test.ts index 5ff9da1..27e14aa 100644 --- a/__TESTS__/unit/actions/Resize/MinimumPadAction.test.ts +++ b/__TESTS__/unit/actions/Resize/MinimumPadAction.test.ts @@ -1,25 +1,28 @@ -import {Transformation} from "../../../../src"; -import {Background} from "../../../../src/qualifiers/background"; -import {minimumPad} from "../../../../src/actions/resize"; -import {Gravity} from "../../../../src/qualifiers/gravity"; -import {Compass} from "../../../../src/qualifiers/compass"; +import { Transformation } from "../../../../src"; +import { Background } from "../../../../src/qualifiers/background"; +import { minimumPad } from "../../../../src/actions/resize"; +import { Gravity } from "../../../../src/qualifiers/gravity"; +import { Compass } from "../../../../src/qualifiers/compass"; -describe('Tests for Transformation Action -- Resize.minimumPad', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.minimumPad", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(minimumPad(250, 250)).toString(); - expect(tx).toContain('c_mpad,h_250,w_250'); + expect(tx).toContain("c_mpad,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - minimumPad() - .width(250) - .height(250) - .gravity(Gravity.compass(Compass.west())) - .offsetX(10) - .offsetY(10) - .background(Background.color('red')) - .aspectRatio(1.2)).toString(); - expect(tx).toContain('ar_1.2,b_red,c_mpad,g_west,h_250,w_250,x_10,y_10'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize( + minimumPad() + .width(250) + .height(250) + .gravity(Gravity.compass(Compass.west())) + .offsetX(10) + .offsetY(10) + .background(Background.color("red")) + .aspectRatio(1.2) + ) + .toString(); + expect(tx).toContain("ar_1.2,b_red,c_mpad,g_west,h_250,w_250,x_10,y_10"); }); }); diff --git a/__TESTS__/unit/actions/Resize/PadAction.test.ts b/__TESTS__/unit/actions/Resize/PadAction.test.ts index 4ca7caa..37f828a 100644 --- a/__TESTS__/unit/actions/Resize/PadAction.test.ts +++ b/__TESTS__/unit/actions/Resize/PadAction.test.ts @@ -1,25 +1,28 @@ -import {Transformation} from "../../../../src"; -import {pad} from "../../../../src/actions/resize"; -import {Background} from "../../../../src/qualifiers/background"; -import {Gravity} from "../../../../src/qualifiers/gravity"; -import {Compass} from "../../../../src/qualifiers/compass"; +import { Transformation } from "../../../../src"; +import { pad } from "../../../../src/actions/resize"; +import { Background } from "../../../../src/qualifiers/background"; +import { Gravity } from "../../../../src/qualifiers/gravity"; +import { Compass } from "../../../../src/qualifiers/compass"; -describe('Tests for Transformation Action -- Resize.pad', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.pad", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(pad(250, 250)).toString(); - expect(tx).toContain('c_pad,h_250,w_250'); + expect(tx).toContain("c_pad,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - pad() - .width(250) - .height(250) - .gravity(Gravity.compass(Compass.west())) - .offsetX(10) - .offsetY(10) - .background(Background.color('red')) - .aspectRatio(1.2)).toString(); - expect(tx).toContain('ar_1.2,b_red,c_pad,g_west,h_250,w_250,x_10,y_10'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize( + pad() + .width(250) + .height(250) + .gravity(Gravity.compass(Compass.west())) + .offsetX(10) + .offsetY(10) + .background(Background.color("red")) + .aspectRatio(1.2) + ) + .toString(); + expect(tx).toContain("ar_1.2,b_red,c_pad,g_west,h_250,w_250,x_10,y_10"); }); }); diff --git a/__TESTS__/unit/actions/Resize/ScaleAction.test.ts b/__TESTS__/unit/actions/Resize/ScaleAction.test.ts index dd59f1f..e78dd3d 100644 --- a/__TESTS__/unit/actions/Resize/ScaleAction.test.ts +++ b/__TESTS__/unit/actions/Resize/ScaleAction.test.ts @@ -1,19 +1,16 @@ -import {Transformation} from "../../../../src"; -import {scale} from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; +import { scale } from "../../../../src/actions/resize"; -describe('Tests for Transformation Action -- Resize.scale', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.scale", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(scale(250, 250)).toString(); - expect(tx).toContain('c_scale,h_250,w_250'); + expect(tx).toContain("c_scale,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - scale() - .width(250) - .height(250) - .liquidRescaling() - .aspectRatio(1.2)).toString(); - expect(tx).toContain('ar_1.2,c_scale,g_liquid,h_250,w_250'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize(scale().width(250).height(250).liquidRescaling().aspectRatio(1.2)) + .toString(); + expect(tx).toContain("ar_1.2,c_scale,g_liquid,h_250,w_250"); }); }); diff --git a/__TESTS__/unit/actions/Resize/ThumbAction.test.ts b/__TESTS__/unit/actions/Resize/ThumbAction.test.ts index 963b2a8..7813af1 100644 --- a/__TESTS__/unit/actions/Resize/ThumbAction.test.ts +++ b/__TESTS__/unit/actions/Resize/ThumbAction.test.ts @@ -1,22 +1,18 @@ -import {Transformation} from "../../../../src"; -import {thumbnail} from "../../../../src/actions/resize"; -import {Compass} from "../../../../src/qualifiers/compass"; -import {Gravity} from "../../../../src/qualifiers/gravity"; +import { Transformation } from "../../../../src"; +import { thumbnail } from "../../../../src/actions/resize"; +import { Compass } from "../../../../src/qualifiers/compass"; +import { Gravity } from "../../../../src/qualifiers/gravity"; -describe('Tests for Transformation Action -- Resize.thumb()', () => { - it('Ensures it generates the right transformation', () => { +describe("Tests for Transformation Action -- Resize.thumb()", () => { + it("Ensures it generates the right transformation", () => { const tx = new Transformation().resize(thumbnail(250, 250)).toString(); - expect(tx).toContain('c_thumb,h_250,w_250'); + expect(tx).toContain("c_thumb,h_250,w_250"); }); - it('Ensures it generates the right transformation using qualifiers', () => { - const tx = new Transformation().resize( - thumbnail() - .width(250) - .height(250) - .aspectRatio(2) - .gravity(Gravity.compass(Compass.west())) - .zoom(2.5)).toString(); - expect(tx).toContain('ar_2.0,c_thumb,g_west,h_250,w_250,z_2.5'); + it("Ensures it generates the right transformation using qualifiers", () => { + const tx = new Transformation() + .resize(thumbnail().width(250).height(250).aspectRatio(2).gravity(Gravity.compass(Compass.west())).zoom(2.5)) + .toString(); + expect(tx).toContain("ar_2.0,c_thumb,g_west,h_250,w_250,z_2.5"); }); }); diff --git a/__TESTS__/unit/actions/Rotate.test.ts b/__TESTS__/unit/actions/Rotate.test.ts index 1355492..d911738 100644 --- a/__TESTS__/unit/actions/Rotate.test.ts +++ b/__TESTS__/unit/actions/Rotate.test.ts @@ -1,11 +1,9 @@ -import * as Rotate from '../../../src/actions/rotate'; +import * as Rotate from "../../../src/actions/rotate"; import * as RotationMode from "../../../src/qualifiers/rotationMode"; -import {Transformation} from "../../../src"; +import { Transformation } from "../../../src"; - - -describe('Tests for Transformation Action -- Rotate', () => { - it('Creates a Transformation with Rotate', () => { +describe("Tests for Transformation Action -- Rotate", () => { + it("Creates a Transformation with Rotate", () => { const tx = new Transformation() .rotate(Rotate.mode(RotationMode.verticalFlip())) .rotate(Rotate.mode(RotationMode.horizontalFlip())) @@ -15,15 +13,12 @@ describe('Tests for Transformation Action -- Rotate', () => { .rotate(Rotate.byAngle(40)) .toString(); - expect(tx).toContain('a_vflip/a_hflip/a_auto_left/a_auto_right/a_ignore/a_40'); + expect(tx).toContain("a_vflip/a_hflip/a_auto_left/a_auto_right/a_ignore/a_40"); }); - it('Can use shortened Rotate notation', () => { - const tx = new Transformation() - .rotate(Rotate.mode("hflip")) - .rotate(Rotate.byAngle(40)) - .toString(); + it("Can use shortened Rotate notation", () => { + const tx = new Transformation().rotate(Rotate.mode("hflip")).rotate(Rotate.byAngle(40)).toString(); - expect(tx).toContain('a_hflip/a_40'); + expect(tx).toContain("a_hflip/a_40"); }); }); diff --git a/__TESTS__/unit/actions/RoundCorners.test.ts b/__TESTS__/unit/actions/RoundCorners.test.ts index 77b026e..1e9afa4 100644 --- a/__TESTS__/unit/actions/RoundCorners.test.ts +++ b/__TESTS__/unit/actions/RoundCorners.test.ts @@ -1,51 +1,34 @@ -import {byRadius, max} from 'actions/roundCorners'; -import {Transformation} from "../../../src"; +import { byRadius, max } from "actions/roundCorners"; +import { Transformation } from "../../../src"; - - - - -describe('Tests for Transformation Action -- RoundCorners', () => { - - it('Ensure roundCorners accepts 1 radius', () => { - const tx = new Transformation() - .roundCorners(byRadius(25)) - .toString(); - expect(tx).toContain('r_25'); +describe("Tests for Transformation Action -- RoundCorners", () => { + it("Ensure roundCorners accepts 1 radius", () => { + const tx = new Transformation().roundCorners(byRadius(25)).toString(); + expect(tx).toContain("r_25"); }); - it('Ensure roundCorners accepts 2 radius', () => { - const tx = new Transformation() - .roundCorners(byRadius(25, 20)) - .toString(); - expect(tx).toContain('r_25:20'); + it("Ensure roundCorners accepts 2 radius", () => { + const tx = new Transformation().roundCorners(byRadius(25, 20)).toString(); + expect(tx).toContain("r_25:20"); }); - it('Ensure roundCorners accepts 3 radius', () => { - const tx = new Transformation() - .roundCorners(byRadius(25, 20, 15)) - .toString(); - expect(tx).toContain('r_25:20:15'); + it("Ensure roundCorners accepts 3 radius", () => { + const tx = new Transformation().roundCorners(byRadius(25, 20, 15)).toString(); + expect(tx).toContain("r_25:20:15"); }); - it('Ensure roundCorners accepts 4 radius', () => { - const tx = new Transformation() - .roundCorners(byRadius(25, 20, 15, 10)) - .toString(); - expect(tx).toContain('r_25:20:15:10'); + it("Ensure roundCorners accepts 4 radius", () => { + const tx = new Transformation().roundCorners(byRadius(25, 20, 15, 10)).toString(); + expect(tx).toContain("r_25:20:15:10"); }); - it('Ensure roundCorners accepts 4 radius, including zeroes', () => { - const tx = new Transformation() - .roundCorners(byRadius(25, 0, 0, 0)) - .toString(); - expect(tx).toContain('r_25:0:0:0'); + it("Ensure roundCorners accepts 4 radius, including zeroes", () => { + const tx = new Transformation().roundCorners(byRadius(25, 0, 0, 0)).toString(); + expect(tx).toContain("r_25:0:0:0"); }); - it('Ensure roundCorners accepts max radius', () => { - const tx = new Transformation() - .roundCorners(max()) - .toString(); - expect(tx).toContain('r_max'); + it("Ensure roundCorners accepts max radius", () => { + const tx = new Transformation().roundCorners(max()).toString(); + expect(tx).toContain("r_max"); }); }); diff --git a/__TESTS__/unit/actions/Transcode.test.ts b/__TESTS__/unit/actions/Transcode.test.ts index ea06b90..8abfb12 100644 --- a/__TESTS__/unit/actions/Transcode.test.ts +++ b/__TESTS__/unit/actions/Transcode.test.ts @@ -1,203 +1,153 @@ -import {AnimatedFormat} from "../../../src/qualifiers/animatedFormat"; -import {AudioFrequency} from "../../../src/qualifiers/audioFrequency"; -import {audioCodec, Transcode} from "../../../src/actions/transcode"; -import {AudioCodec} from "../../../src/qualifiers/audioCodec"; -import {StreamingProfile} from "../../../src/qualifiers/streamingProfile"; -import {VideoCodec} from "../../../src/qualifiers/videoCodec"; -import {VideoCodecLevel} from "../../../src/qualifiers/videoCodecLevel"; -import {VideoCodecProfile} from "../../../src/qualifiers/videoCodecProfile"; -import {scale} from "../../../src/actions/resize"; -import {Transformation} from "../../../src"; - -describe('Tests for Transformation Action -- Transcode', () => { - it('Creates a Transformation with audiocodec', () => { - const tx = new Transformation() - .transcode(Transcode.audioCodec(AudioCodec.aac())) - .toString(); +import { AnimatedFormat } from "../../../src/qualifiers/animatedFormat"; +import { AudioFrequency } from "../../../src/qualifiers/audioFrequency"; +import { audioCodec, Transcode } from "../../../src/actions/transcode"; +import { AudioCodec } from "../../../src/qualifiers/audioCodec"; +import { StreamingProfile } from "../../../src/qualifiers/streamingProfile"; +import { VideoCodec } from "../../../src/qualifiers/videoCodec"; +import { VideoCodecLevel } from "../../../src/qualifiers/videoCodecLevel"; +import { VideoCodecProfile } from "../../../src/qualifiers/videoCodecProfile"; +import { scale } from "../../../src/actions/resize"; +import { Transformation } from "../../../src"; - expect(tx).toBe('ac_aac'); +describe("Tests for Transformation Action -- Transcode", () => { + it("Creates a Transformation with audiocodec", () => { + const tx = new Transformation().transcode(Transcode.audioCodec(AudioCodec.aac())).toString(); + + expect(tx).toBe("ac_aac"); }); - it('Can use shortened audioCodec notation', () => { - const tx = new Transformation() - .transcode(audioCodec('aac')) - .toString(); + it("Can use shortened audioCodec notation", () => { + const tx = new Transformation().transcode(audioCodec("aac")).toString(); - expect(tx).toBe('ac_aac'); + expect(tx).toBe("ac_aac"); }); - it('Creates a Transformation with bitrate', () => { - const tx = new Transformation() - .transcode(Transcode.bitRate('500k')) - .toString(); + it("Creates a Transformation with bitrate", () => { + const tx = new Transformation().transcode(Transcode.bitRate("500k")).toString(); - expect(tx).toBe('br_500k'); + expect(tx).toBe("br_500k"); }); - it('Creates a Transformation with bitrate.constant', () => { - const tx = new Transformation() - .transcode(Transcode - .bitRate(500).constant()) - .toString(); + it("Creates a Transformation with bitrate.constant", () => { + const tx = new Transformation().transcode(Transcode.bitRate(500).constant()).toString(); - expect(tx).toBe('br_500:constant'); + expect(tx).toBe("br_500:constant"); }); - it('Creates a Transformation with audioFrequency', () => { - const tx = new Transformation() - .transcode(Transcode - .audioFrequency(AudioFrequency.FREQ11025())) - .toString(); + it("Creates a Transformation with audioFrequency", () => { + const tx = new Transformation().transcode(Transcode.audioFrequency(AudioFrequency.FREQ11025())).toString(); - expect(tx).toBe('af_11025'); + expect(tx).toBe("af_11025"); }); - it('Can use shortened audioFrequency notation', () => { - const tx = new Transformation() - .transcode(Transcode - .audioFrequency(11025)) - .toString(); + it("Can use shortened audioFrequency notation", () => { + const tx = new Transformation().transcode(Transcode.audioFrequency(11025)).toString(); - expect(tx).toBe('af_11025'); + expect(tx).toBe("af_11025"); }); - it('Creates a Transformation with fps', () => { - const tx = new Transformation() - .transcode(Transcode - .fps(20)) - .toString(); + it("Creates a Transformation with fps", () => { + const tx = new Transformation().transcode(Transcode.fps(20)).toString(); - expect(tx).toBe('fps_20'); + expect(tx).toBe("fps_20"); }); - it('Creates a Transformation with fpsRange from', () => { - const tx = new Transformation() - .transcode(Transcode - .fpsRange(20)) - .toString(); + it("Creates a Transformation with fpsRange from", () => { + const tx = new Transformation().transcode(Transcode.fpsRange(20)).toString(); - expect(tx).toBe('fps_20-'); + expect(tx).toBe("fps_20-"); }); - it('Creates a Transformation with fpsRange from-to', () => { - const tx = new Transformation() - .transcode(Transcode - .fpsRange(20, 20)) - .toString(); + it("Creates a Transformation with fpsRange from-to", () => { + const tx = new Transformation().transcode(Transcode.fpsRange(20, 20)).toString(); - expect(tx).toBe('fps_20-20'); + expect(tx).toBe("fps_20-20"); }); - it('Creates a Transformation with keyframeInterval', () => { + it("Creates a Transformation with keyframeInterval", () => { const tx = new Transformation() - .transcode(Transcode - .keyframeInterval(0.4)) - .transcode(Transcode - .keyframeInterval('0.8')) + .transcode(Transcode.keyframeInterval(0.4)) + .transcode(Transcode.keyframeInterval("0.8")) .toString(); - expect(tx).toBe('ki_0.4/ki_0.8'); + expect(tx).toBe("ki_0.4/ki_0.8"); }); - it('Creates a Transformation with streamingProfile', () => { - const tx = new Transformation() - .transcode(Transcode - .streamingProfile(StreamingProfile.fullHd())) - .toString(); + it("Creates a Transformation with streamingProfile", () => { + const tx = new Transformation().transcode(Transcode.streamingProfile(StreamingProfile.fullHd())).toString(); - expect(tx).toBe('sp_full_hd'); + expect(tx).toBe("sp_full_hd"); }); - it('Can use shortened streamingProfile notation', () => { - const tx = new Transformation() - .transcode(Transcode - .streamingProfile("full_hd")) - .toString(); + it("Can use shortened streamingProfile notation", () => { + const tx = new Transformation().transcode(Transcode.streamingProfile("full_hd")).toString(); - expect(tx).toBe('sp_full_hd'); + expect(tx).toBe("sp_full_hd"); }); - it('Creates a Transformation with toAnimated', () => { - const tx = new Transformation() - .transcode(Transcode - .toAnimated(AnimatedFormat.gif())) - .toString(); + it("Creates a Transformation with toAnimated", () => { + const tx = new Transformation().transcode(Transcode.toAnimated(AnimatedFormat.gif())).toString(); - expect(tx).toBe('f_gif,fl_animated'); + expect(tx).toBe("f_gif,fl_animated"); }); - it('Creates a Transformation with toAnimated webp', () => { - const tx = new Transformation() - .transcode(Transcode - .toAnimated(AnimatedFormat.webp())) - .toString(); + it("Creates a Transformation with toAnimated webp", () => { + const tx = new Transformation().transcode(Transcode.toAnimated(AnimatedFormat.webp())).toString(); - expect(tx).toBe('f_webp,fl_animated,fl_awebp'); + expect(tx).toBe("f_webp,fl_animated,fl_awebp"); }); - it('Can use shortened toAnimated webp', () => { - const tx = new Transformation() - .transcode(Transcode - .toAnimated('webp')) - .toString(); + it("Can use shortened toAnimated webp", () => { + const tx = new Transformation().transcode(Transcode.toAnimated("webp")).toString(); - expect(tx).toBe('f_webp,fl_animated,fl_awebp'); + expect(tx).toBe("f_webp,fl_animated,fl_awebp"); }); - it('Creates a Transformation with toAnimated and delay', () => { - const tx = new Transformation() - .transcode(Transcode - .toAnimated('gif').delay(20)) - .toString(); + it("Creates a Transformation with toAnimated and delay", () => { + const tx = new Transformation().transcode(Transcode.toAnimated("gif").delay(20)).toString(); - expect(tx).toBe('dl_20,f_gif,fl_animated'); + expect(tx).toBe("dl_20,f_gif,fl_animated"); }); - it('Creates a Transformation with toAnimated, delay, sampling', () => { + it("Creates a Transformation with toAnimated, delay, sampling", () => { const tx = new Transformation() - .transcode(Transcode - .toAnimated(AnimatedFormat.gif()).delay(20).sampling('4s')) + .transcode(Transcode.toAnimated(AnimatedFormat.gif()).delay(20).sampling("4s")) .toString(); - expect(tx).toBe('dl_20,f_gif,fl_animated,vs_4s'); + expect(tx).toBe("dl_20,f_gif,fl_animated,vs_4s"); }); - it('Tests for simple videoCodec', () => { - const tx = new Transformation().transcode( - Transcode.videoCodec(VideoCodec.vp9()) - ).toString(); - expect(tx).toContain('vc_vp9'); + it("Tests for simple videoCodec", () => { + const tx = new Transformation().transcode(Transcode.videoCodec(VideoCodec.vp9())).toString(); + expect(tx).toContain("vc_vp9"); }); - it('Tests for all codec types', () => { - expect(VideoCodec.vp8().toString()).toEqual('vc_vp8'); - expect(VideoCodec.proRes().toString()).toEqual('vc_prores'); - expect(VideoCodec.theora().toString()).toEqual('vc_theora'); - expect(VideoCodec.auto().toString()).toEqual('vc_auto'); + it("Tests for all codec types", () => { + expect(VideoCodec.vp8().toString()).toEqual("vc_vp8"); + expect(VideoCodec.proRes().toString()).toEqual("vc_prores"); + expect(VideoCodec.theora().toString()).toEqual("vc_theora"); + expect(VideoCodec.auto().toString()).toEqual("vc_auto"); }); - it('Tests for all codecLevels', () => { + it("Tests for all codecLevels", () => { // @TODO - do we need to change 3 to 3.0 in the transformation? - expect(VideoCodecLevel.vcl30()).toEqual('3.0'); + expect(VideoCodecLevel.vcl30()).toEqual("3.0"); expect(VideoCodecLevel.vcl31()).toEqual(3.1); - expect(VideoCodecLevel.vcl40()).toEqual('4.0'); + expect(VideoCodecLevel.vcl40()).toEqual("4.0"); expect(VideoCodecLevel.vcl41()).toEqual(4.1); expect(VideoCodecLevel.vcl42()).toEqual(4.2); - expect(VideoCodecLevel.vcl50()).toEqual('5.0'); + expect(VideoCodecLevel.vcl50()).toEqual("5.0"); expect(VideoCodecLevel.vcl51()).toEqual(5.1); expect(VideoCodecLevel.vcl52()).toEqual(5.2); }); - it('Tests for adv videoCodec', () => { + it("Tests for adv videoCodec", () => { const tx = new Transformation() .resize(scale().width(100)) .transcode( - Transcode.videoCodec( - VideoCodec.h264() - .profile(VideoCodecProfile.baseline()) - .level(VideoCodecLevel.vcl31()) - ) - ).toString(); - expect(tx).toContain('c_scale,w_100/vc_h264:baseline:3.1'); + Transcode.videoCodec(VideoCodec.h264().profile(VideoCodecProfile.baseline()).level(VideoCodecLevel.vcl31())) + ) + .toString(); + expect(tx).toContain("c_scale,w_100/vc_h264:baseline:3.1"); }); }); diff --git a/__TESTS__/unit/actions/Variable.test.ts b/__TESTS__/unit/actions/Variable.test.ts index 5c0f9c6..affc773 100644 --- a/__TESTS__/unit/actions/Variable.test.ts +++ b/__TESTS__/unit/actions/Variable.test.ts @@ -1,185 +1,153 @@ -import {Transformation} from "../../../src"; -import {setFloat, setInteger, setString, Variable} from "../../../src/actions/variable"; -import {Expression} from "../../../src/qualifiers/expression"; +import { Transformation } from "../../../src"; +import { setFloat, setInteger, setString, Variable } from "../../../src/actions/variable"; +import { Expression } from "../../../src/qualifiers/expression"; -const {set} = Variable; -const {expression} = Expression; +const { set } = Variable; +const { expression } = Expression; -describe('Tests for Transformation Action -- Variable', () => { - it('tests common variable values', () => { - expect(set('a', 30).toString()).toBe('$a_30'); - expect(set('a', '30').toString()).toBe('$a_!30!'); +describe("Tests for Transformation Action -- Variable", () => { + it("tests common variable values", () => { + expect(set("a", 30).toString()).toBe("$a_30"); + expect(set("a", "30").toString()).toBe("$a_!30!"); }); - it('tests setFloat with common variable values', () => { - expect(setFloat('a', -1).toString()).toBe(`$a_-1.0`); - expect(setFloat('a', 0).toString()).toBe(`$a_0.0`); - expect(setFloat('a', 1).toString()).toBe(`$a_1.0`); - expect(setFloat('a', 0.01).toString()).toBe(`$a_0.01`); + it("tests setFloat with common variable values", () => { + expect(setFloat("a", -1).toString()).toBe(`$a_-1.0`); + expect(setFloat("a", 0).toString()).toBe(`$a_0.0`); + expect(setFloat("a", 1).toString()).toBe(`$a_1.0`); + expect(setFloat("a", 0.01).toString()).toBe(`$a_0.01`); }); - it('tests setInteger with common variable values', () => { - expect(setInteger('a', -1).toString()).toBe(`$a_-1`); - expect(setInteger('a', 0).toString()).toBe(`$a_0`); - expect(setInteger('a', 0.9).toString()).toBe(`$a_1`); - expect(setInteger('a', 1).toString()).toBe(`$a_1`); - expect(setInteger('a', 0.01).toString()).toBe(`$a_0`); // Round down + it("tests setInteger with common variable values", () => { + expect(setInteger("a", -1).toString()).toBe(`$a_-1`); + expect(setInteger("a", 0).toString()).toBe(`$a_0`); + expect(setInteger("a", 0.9).toString()).toBe(`$a_1`); + expect(setInteger("a", 1).toString()).toBe(`$a_1`); + expect(setInteger("a", 0.01).toString()).toBe(`$a_0`); // Round down }); - it('tests setString with common variable values', () => { + it("tests setString with common variable values", () => { // Strings are trivially supported, so this test tests for numbers - expect(setString('a', -1).toString()).toBe(`$a_!-1!`); - expect(setString('a', 0).toString()).toBe(`$a_!0!`); - expect(setString('a', 1).toString()).toBe(`$a_!1!`); - expect(setString('a', 0.01).toString()).toBe(`$a_!0.01!`); + expect(setString("a", -1).toString()).toBe(`$a_!-1!`); + expect(setString("a", 0).toString()).toBe(`$a_!0!`); + expect(setString("a", 1).toString()).toBe(`$a_!1!`); + expect(setString("a", 0.01).toString()).toBe(`$a_!0.01!`); }); - it('Creates a Transformation with number variable', () => { - const tx = new Transformation() - .addVariable(set('a', 30)) - .toString(); + it("Creates a Transformation with number variable", () => { + const tx = new Transformation().addVariable(set("a", 30)).toString(); - expect(tx).toBe('$a_30'); + expect(tx).toBe("$a_30"); }); - it('Creates a Transformation with number variable asFloat', () => { - const tx = new Transformation() - .addVariable(set('a', 30).asFloat()) - .toString(); + it("Creates a Transformation with number variable asFloat", () => { + const tx = new Transformation().addVariable(set("a", 30).asFloat()).toString(); - expect(tx).toBe('$a_30_to_f'); + expect(tx).toBe("$a_30_to_f"); }); - it('Creates a Transformation with number variable asInteger', () => { - const tx = new Transformation() - .addVariable(set('a', 30).asInteger()) - .toString(); + it("Creates a Transformation with number variable asInteger", () => { + const tx = new Transformation().addVariable(set("a", 30).asInteger()).toString(); - expect(tx).toBe('$a_30_to_i'); + expect(tx).toBe("$a_30_to_i"); }); - it('Creates a Transformation with a string variable', () => { - const tx = new Transformation() - .addVariable(set('a', 'bbb')) - .toString(); + it("Creates a Transformation with a string variable", () => { + const tx = new Transformation().addVariable(set("a", "bbb")).toString(); - expect(tx).toBe('$a_!bbb!'); + expect(tx).toBe("$a_!bbb!"); }); - it('Creates a Transformation with a string variable and asInteger', () => { - const tx = new Transformation() - .addVariable(set('a', 'bbb').asInteger()) - .toString(); + it("Creates a Transformation with a string variable and asInteger", () => { + const tx = new Transformation().addVariable(set("a", "bbb").asInteger()).toString(); - expect(tx).toBe('$a_!bbb!_to_i'); + expect(tx).toBe("$a_!bbb!_to_i"); }); - it('Creates a Transformation with a string variable and asFloat', () => { - const tx = new Transformation() - .addVariable(set('a', 'bbb').asFloat()) - .toString(); + it("Creates a Transformation with a string variable and asFloat", () => { + const tx = new Transformation().addVariable(set("a", "bbb").asFloat()).toString(); - expect(tx).toBe('$a_!bbb!_to_f'); + expect(tx).toBe("$a_!bbb!_to_f"); }); - it('Creates a Transformation with expression', () => { + it("Creates a Transformation with expression", () => { const tx = new Transformation() - .addVariable(Variable.set('myexp', Expression.expression('initial_width + 100 / 3'))) + .addVariable(Variable.set("myexp", Expression.expression("initial_width + 100 / 3"))) .toString(); - expect(tx).toBe('$myexp_iw_add_100_div_3'); + expect(tx).toBe("$myexp_iw_add_100_div_3"); }); - it('Creates a Transformation with expression and asFloat', () => { + it("Creates a Transformation with expression and asFloat", () => { const tx = new Transformation() - .addVariable(Variable.set('myexp', expression('initial_width + 100 / 3')).asFloat()) + .addVariable(Variable.set("myexp", expression("initial_width + 100 / 3")).asFloat()) .toString(); - expect(tx).toBe('$myexp_iw_add_100_div_3_to_f'); + expect(tx).toBe("$myexp_iw_add_100_div_3_to_f"); }); - it('Creates a Transformation with array', () => { - const tx = new Transformation() - .addVariable(Variable.set('list', ['a', 'b', 'c'])) - .toString(); + it("Creates a Transformation with array", () => { + const tx = new Transformation().addVariable(Variable.set("list", ["a", "b", "c"])).toString(); - expect(tx).toBe('$list_!a:b:c!'); + expect(tx).toBe("$list_!a:b:c!"); }); - it('Creates a Transformation with setReference', () => { - const tx = new Transformation() - .addVariable(Variable.setAssetReference('myexp', 'my_file')) - .toString(); + it("Creates a Transformation with setReference", () => { + const tx = new Transformation().addVariable(Variable.setAssetReference("myexp", "my_file")).toString(); - expect(tx).toBe('$myexp_ref:!my_file!'); + expect(tx).toBe("$myexp_ref:!my_file!"); }); - it('Creates a Transformation with setReference and asInteger', () => { - const tx = new Transformation() - .addVariable(Variable.setAssetReference('myexp', 'my_file').asInteger()) - .toString(); + it("Creates a Transformation with setReference and asInteger", () => { + const tx = new Transformation().addVariable(Variable.setAssetReference("myexp", "my_file").asInteger()).toString(); - expect(tx).toBe('$myexp_ref:!my_file!_to_i'); + expect(tx).toBe("$myexp_ref:!my_file!_to_i"); }); - it('Creates a Transformation with setReference and asFloat', () => { - const tx = new Transformation() - .addVariable(Variable.setAssetReference('myexp', 'my_file').asFloat()) - .toString(); + it("Creates a Transformation with setReference and asFloat", () => { + const tx = new Transformation().addVariable(Variable.setAssetReference("myexp", "my_file").asFloat()).toString(); - expect(tx).toBe('$myexp_ref:!my_file!_to_f'); + expect(tx).toBe("$myexp_ref:!my_file!_to_f"); }); - it('Creates a Transformation with setFromContext', () => { - const tx = new Transformation() - .addVariable(Variable.setFromContext('myexp', 'my_file')) - .toString(); + it("Creates a Transformation with setFromContext", () => { + const tx = new Transformation().addVariable(Variable.setFromContext("myexp", "my_file")).toString(); - expect(tx).toBe('$myexp_ctx:!my_file!'); + expect(tx).toBe("$myexp_ctx:!my_file!"); }); - it('Creates a Transformation with setFromContext and asInteger', () => { - const tx = new Transformation() - .addVariable(Variable.setFromContext('myexp', 'my_file').asInteger()) - .toString(); + it("Creates a Transformation with setFromContext and asInteger", () => { + const tx = new Transformation().addVariable(Variable.setFromContext("myexp", "my_file").asInteger()).toString(); - expect(tx).toBe('$myexp_ctx:!my_file!_to_i'); + expect(tx).toBe("$myexp_ctx:!my_file!_to_i"); }); - it('Creates a Transformation with setFromContext and asFloat', () => { - const tx = new Transformation() - .addVariable(Variable.setFromContext('myexp', 'my_file').asFloat()) - .toString(); + it("Creates a Transformation with setFromContext and asFloat", () => { + const tx = new Transformation().addVariable(Variable.setFromContext("myexp", "my_file").asFloat()).toString(); - expect(tx).toBe('$myexp_ctx:!my_file!_to_f'); + expect(tx).toBe("$myexp_ctx:!my_file!_to_f"); }); - it('Creates a Transformation with setFromMetadata', () => { - const tx = new Transformation() - .addVariable(Variable.setFromMetadata('myexp', 'my_file')) - .toString(); + it("Creates a Transformation with setFromMetadata", () => { + const tx = new Transformation().addVariable(Variable.setFromMetadata("myexp", "my_file")).toString(); - expect(tx).toBe('$myexp_md:!my_file!'); + expect(tx).toBe("$myexp_md:!my_file!"); }); - it('Creates a Transformation with setFromMetadata and asInteger', () => { - const tx = new Transformation() - .addVariable(Variable.setFromMetadata('myexp', 'my_file').asInteger()) - .toString(); + it("Creates a Transformation with setFromMetadata and asInteger", () => { + const tx = new Transformation().addVariable(Variable.setFromMetadata("myexp", "my_file").asInteger()).toString(); - expect(tx).toBe('$myexp_md:!my_file!_to_i'); + expect(tx).toBe("$myexp_md:!my_file!_to_i"); }); - it('Creates a Transformation with setFromMetadata and asFloat', () => { - const tx = new Transformation() - .addVariable(Variable.setFromMetadata('myexp', 'my_file').asFloat()) - .toString(); + it("Creates a Transformation with setFromMetadata and asFloat", () => { + const tx = new Transformation().addVariable(Variable.setFromMetadata("myexp", "my_file").asFloat()).toString(); - expect(tx).toBe('$myexp_md:!my_file!_to_f'); + expect(tx).toBe("$myexp_md:!my_file!_to_f"); }); - it('Tests special cases are not modified in expressions', () => { - ['$myheight', '$heightheight', '$theheight', '$__height'].forEach((exp: string) => { + it("Tests special cases are not modified in expressions", () => { + ["$myheight", "$heightheight", "$theheight", "$__height"].forEach((exp: string) => { expect(Expression.expression(exp).toString()).toBe(exp); }); }); diff --git a/__TESTS__/unit/actions/VideoEdit.test.ts b/__TESTS__/unit/actions/VideoEdit.test.ts index 7bb20c9..a087794 100644 --- a/__TESTS__/unit/actions/VideoEdit.test.ts +++ b/__TESTS__/unit/actions/VideoEdit.test.ts @@ -1,135 +1,95 @@ -import {Transformation} from "../../../src/transformation/Transformation"; -import {Concatenate} from "../../../src/qualifiers/concatenate"; -import {Volume} from "../../../src/qualifiers/volume"; -import {Transition} from "../../../src/qualifiers/transition"; -import {Effect} from "../../../src/actions/effect"; -import {VideoEdit} from "../../../src/actions/videoEdit"; +import { Transformation } from "../../../src/transformation/Transformation"; +import { Concatenate } from "../../../src/qualifiers/concatenate"; +import { Volume } from "../../../src/qualifiers/volume"; +import { Transition } from "../../../src/qualifiers/transition"; +import { Effect } from "../../../src/actions/effect"; +import { VideoEdit } from "../../../src/actions/videoEdit"; - -describe('Tests for Transformation Action -- VideoEdit', () => { - it('Creates a Transformation with concatenate', () => { - const tx = new Transformation() - .videoEdit( - VideoEdit.concatenate( - Concatenate.videoSource("dog") - ) - ) - .toString(); +describe("Tests for Transformation Action -- VideoEdit", () => { + it("Creates a Transformation with concatenate", () => { + const tx = new Transformation().videoEdit(VideoEdit.concatenate(Concatenate.videoSource("dog"))).toString(); // fl_splice,l_video:dog/{videoTransformation}/fl_layer_apply - expect(tx).toContain('fl_splice,l_video:dog/fl_layer_apply'); + expect(tx).toContain("fl_splice,l_video:dog/fl_layer_apply"); }); - it('Creates a Transformation with concatenate prepend', () => { + it("Creates a Transformation with concatenate prepend", () => { const tx = new Transformation() .videoEdit( - VideoEdit.concatenate( - Concatenate.videoSource("dog") - ) - .prepend() // implicitly true + VideoEdit.concatenate(Concatenate.videoSource("dog")).prepend() // implicitly true ) .toString(); - expect(tx).toBe('fl_splice,l_video:dog/fl_layer_apply,so_0'); + expect(tx).toBe("fl_splice,l_video:dog/fl_layer_apply,so_0"); }); - it('Creates a Transformation with concatenate with transition', () => { + it("Creates a Transformation with concatenate with transition", () => { const src = Concatenate.imageSource("sample"); src.transformation(new Transformation()); src.getTransformation().effect(Effect.sepia()); const tx = new Transformation() - .videoEdit( - VideoEdit.concatenate(src) - .transition(Transition.videoSource("transition1")) - .duration(5) - ).toString(); + .videoEdit(VideoEdit.concatenate(src).transition(Transition.videoSource("transition1")).duration(5)) + .toString(); - expect(tx).toBe('du_5,l_sample/e_sepia/e_transition,l_video:transition1/fl_layer_apply/fl_layer_apply'); + expect(tx).toBe("du_5,l_sample/e_sepia/e_transition,l_video:transition1/fl_layer_apply/fl_layer_apply"); }); - it('Creates a Transformation with trim', () => { - const tx = new Transformation() - .videoEdit(VideoEdit.trim() - .startOffset(3) - .endOffset(4) - .duration(10)) - .toString(); + it("Creates a Transformation with trim", () => { + const tx = new Transformation().videoEdit(VideoEdit.trim().startOffset(3).endOffset(4).duration(10)).toString(); - expect(tx).toBe('du_10,eo_4,so_3'); + expect(tx).toBe("du_10,eo_4,so_3"); }); - it('Creates a Transformation with trim and percent duration', () => { - const tx = new Transformation() - .videoEdit(VideoEdit.trim() - .startOffset(3) - .endOffset(4) - .duration('10%')) - .toString(); + it("Creates a Transformation with trim and percent duration", () => { + const tx = new Transformation().videoEdit(VideoEdit.trim().startOffset(3).endOffset(4).duration("10%")).toString(); - expect(tx).toBe('du_10p,eo_4,so_3'); + expect(tx).toBe("du_10p,eo_4,so_3"); }); - it('Creates a Transformation with trim %', () => { + it("Creates a Transformation with trim %", () => { const tx = new Transformation() - .videoEdit(VideoEdit.trim() - .startOffset('3%') - .endOffset('4%') - .duration('10%')) + .videoEdit(VideoEdit.trim().startOffset("3%").endOffset("4%").duration("10%")) .toString(); - expect(tx).toBe('du_10p,eo_4p,so_3p'); + expect(tx).toBe("du_10p,eo_4p,so_3p"); }); - it('Creates a Transformation with volume string', () => { - const tx = new Transformation() - .videoEdit(VideoEdit.volume('5db')) - .toString(); + it("Creates a Transformation with volume string", () => { + const tx = new Transformation().videoEdit(VideoEdit.volume("5db")).toString(); - expect(tx).toBe('e_volume:5db'); + expect(tx).toBe("e_volume:5db"); }); - it('Creates a Transformation with volume number', () => { - const tx = new Transformation() - .videoEdit(VideoEdit.volume(10)) - .toString(); + it("Creates a Transformation with volume number", () => { + const tx = new Transformation().videoEdit(VideoEdit.volume(10)).toString(); - expect(tx).toBe('e_volume:10'); + expect(tx).toBe("e_volume:10"); }); - it('Creates a Transformation with volume Volume.mute()', () => { - const tx = new Transformation() - .videoEdit(VideoEdit.volume(Volume.mute())) - .toString(); + it("Creates a Transformation with volume Volume.mute()", () => { + const tx = new Transformation().videoEdit(VideoEdit.volume(Volume.mute())).toString(); - expect(tx).toBe('e_volume:mute'); + expect(tx).toBe("e_volume:mute"); }); - it('Creates a Transformation with volume Volume.byDecibels()', () => { - const tx = new Transformation() - .videoEdit(VideoEdit.volume(Volume.byDecibels(5))) - .toString(); + it("Creates a Transformation with volume Volume.byDecibels()", () => { + const tx = new Transformation().videoEdit(VideoEdit.volume(Volume.byDecibels(5))).toString(); - expect(tx).toBe('e_volume:5db'); + expect(tx).toBe("e_volume:5db"); }); - it('Creates a Transformation with volume Volume.byPercent()', () => { - const tx = new Transformation() - .videoEdit(VideoEdit.volume(Volume.byPercent('10'))) - .toString(); + it("Creates a Transformation with volume Volume.byPercent()", () => { + const tx = new Transformation().videoEdit(VideoEdit.volume(Volume.byPercent("10"))).toString(); - expect(tx).toBe('e_volume:10'); + expect(tx).toBe("e_volume:10"); }); - it('Tests a preview transformation for a video', () => { + it("Tests a preview transformation for a video", () => { const tx = new Transformation() - .videoEdit( - VideoEdit.preview() - .duration(5) - .minimumSegmentDuration(1) - .maximumSegments(10) - ).toString(); + .videoEdit(VideoEdit.preview().duration(5).minimumSegmentDuration(1).maximumSegments(10)) + .toString(); - expect(tx).toContain('e_preview:duration_5.0:max_seg_10:min_seg_dur_1.0'); + expect(tx).toContain("e_preview:duration_5.0:max_seg_10:min_seg_dur_1.0"); }); }); diff --git a/__TESTS__/unit/expression.test.ts b/__TESTS__/unit/expression.test.ts index 40ab9a7..b17bc39 100644 --- a/__TESTS__/unit/expression.test.ts +++ b/__TESTS__/unit/expression.test.ts @@ -1,44 +1,41 @@ -import {expression} from "../../src/qualifiers/expression"; +import { expression } from "../../src/qualifiers/expression"; const cases: Record = { - 'empty string is not affected': ['', ''], - 'normalize greater than': ['$foo > $bar', '$foo_gt_$bar'], - 'custom tags': ['if_!my_custom_tag! in tags', 'if_!my_custom_tag!_in_tags'], - 'single space is replaced with a single underscore': [' ', '_'], - 'blank string is replaced with a single underscore': [' ', '___'], - 'underscore is not affected': ['_', '_'], - 'sequence of underscores and spaces is changed to just underscores': [' _ __ _', '________'], - 'arbitrary text is not affected': ['foobar', 'foobar'], - 'duration is recognized as a variable and replaced with du': ['duration', 'du'], - 'double ampersand replaced with and operator': ['foo && bar', 'foo_and_bar'], - 'double ampersand with no space at the end is not affected': ['foo&&bar', 'foo&&bar'], - 'width recognized as variable and replaced with w': ['width', 'w'], - 'initial aspect ratio recognized as variable and replaced with iar': ['initial_aspect_ratio', 'iar'], - '$width recognized as user variable and not affected': ['$width', '$width'], - '$initial_aspect_ratio recognized as user variable followed by aspect_ratio variable': [ - '$initial_aspect_ratio', - '$initial_ar' + "empty string is not affected": ["", ""], + "normalize greater than": ["$foo > $bar", "$foo_gt_$bar"], + "custom tags": ["if_!my_custom_tag! in tags", "if_!my_custom_tag!_in_tags"], + "single space is replaced with a single underscore": [" ", "_"], + "blank string is replaced with a single underscore": [" ", "___"], + "underscore is not affected": ["_", "_"], + "sequence of underscores and spaces is changed to just underscores": [" _ __ _", "________"], + "arbitrary text is not affected": ["foobar", "foobar"], + "duration is recognized as a variable and replaced with du": ["duration", "du"], + "double ampersand replaced with and operator": ["foo && bar", "foo_and_bar"], + "double ampersand with no space at the end is not affected": ["foo&&bar", "foo&&bar"], + "width recognized as variable and replaced with w": ["width", "w"], + "initial aspect ratio recognized as variable and replaced with iar": ["initial_aspect_ratio", "iar"], + "$width recognized as user variable and not affected": ["$width", "$width"], + "$initial_aspect_ratio recognized as user variable followed by aspect_ratio variable": [ + "$initial_aspect_ratio", + "$initial_ar", ], - '$mywidth recognized as user variable and not affected': ['$mywidth', '$mywidth'], - '$widthwidth recognized as user variable and not affected': ['$widthwidth', '$widthwidth'], - '$_width recognized as user variable and not affected': ['$_width', '$_width'], - '$__width recognized as user variable and not affected': ['$__width', '$__width'], - '$$width recognized as user variable and not affected': ['$$width', '$$width'], - '$height recognized as user variable and not affected': ['$height_100', '$height_100'], - '$heightt_100 recognized as user variable and not affected': ['$heightt_100', '$heightt_100'], - '$$height_100 recognized as user variable and not affected': ['$$height_100', '$$height_100'], - '$heightmy_100 recognized as user variable and not affected': ['$heightmy_100', '$heightmy_100'], - '$myheight_100 recognized as user variable and not affected': ['$myheight_100', '$myheight_100'], - '$heightheight_100 recognized as user variable and not affected': [ - '$heightheight_100', - '$heightheight_100' - ], - '$theheight_100 recognized as user variable and not affected': ['$theheight_100', '$theheight_100'], - '$__height_100 recognized as user variable and not affected': ['$__height_100', '$__height_100'] + "$mywidth recognized as user variable and not affected": ["$mywidth", "$mywidth"], + "$widthwidth recognized as user variable and not affected": ["$widthwidth", "$widthwidth"], + "$_width recognized as user variable and not affected": ["$_width", "$_width"], + "$__width recognized as user variable and not affected": ["$__width", "$__width"], + "$$width recognized as user variable and not affected": ["$$width", "$$width"], + "$height recognized as user variable and not affected": ["$height_100", "$height_100"], + "$heightt_100 recognized as user variable and not affected": ["$heightt_100", "$heightt_100"], + "$$height_100 recognized as user variable and not affected": ["$$height_100", "$$height_100"], + "$heightmy_100 recognized as user variable and not affected": ["$heightmy_100", "$heightmy_100"], + "$myheight_100 recognized as user variable and not affected": ["$myheight_100", "$myheight_100"], + "$heightheight_100 recognized as user variable and not affected": ["$heightheight_100", "$heightheight_100"], + "$theheight_100 recognized as user variable and not affected": ["$theheight_100", "$theheight_100"], + "$__height_100 recognized as user variable and not affected": ["$__height_100", "$__height_100"], }; -describe('Tests for Transformation Action -- Variable', () => { - it('tests expressions values', () => { +describe("Tests for Transformation Action -- Variable", () => { + it("tests expressions values", () => { Object.keys(cases).forEach(function (testDescription) { const [input, expected] = cases[testDescription]; expect(expression(input).toString()).toBe(expected); diff --git a/__TESTS__/unit/fromJson/adjust.fromJson.test.ts b/__TESTS__/unit/fromJson/adjust.fromJson.test.ts index c99b413..d652cce 100644 --- a/__TESTS__/unit/fromJson/adjust.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/adjust.fromJson.test.ts @@ -1,25 +1,29 @@ -import {fromJson} from "../../../src/internal/fromJson"; +import { fromJson } from "../../../src/internal/fromJson"; -describe('adjust.fromJson', () => { - it('should generate a url with adjust actions from array of models', function () { - const transformation = fromJson({actions:[ - { actionType: 'improve', mode: 'outdoor', blend: 30}, - { actionType: 'unsharpMask', strength: 50}, - { actionType: 'saturation', level: 40}, - {actionType: 'contrast', level: 40}, - {actionType: 'brightness', level: 30}, - {actionType: 'gamma', level: 30}, - {actionType: 'opacity', level: 30} - ]}); +describe("adjust.fromJson", () => { + it("should generate a url with adjust actions from array of models", function () { + const transformation = fromJson({ + actions: [ + { actionType: "improve", mode: "outdoor", blend: 30 }, + { actionType: "unsharpMask", strength: 50 }, + { actionType: "saturation", level: 40 }, + { actionType: "contrast", level: 40 }, + { actionType: "brightness", level: 30 }, + { actionType: "gamma", level: 30 }, + { actionType: "opacity", level: 30 }, + ], + }); - expect(transformation.toString()).toStrictEqual([ - 'e_improve:outdoor:30', - 'e_unsharp_mask:50', - 'e_saturation:40', - 'e_contrast:40', - 'e_brightness:30', - 'e_gamma:30', - 'o_30' - ].join('/')); + expect(transformation.toString()).toStrictEqual( + [ + "e_improve:outdoor:30", + "e_unsharp_mask:50", + "e_saturation:40", + "e_contrast:40", + "e_brightness:30", + "e_gamma:30", + "o_30", + ].join("/") + ); }); }); diff --git a/__TESTS__/unit/fromJson/backgroundRemoval.fromJson.test.ts b/__TESTS__/unit/fromJson/backgroundRemoval.fromJson.test.ts index ea2cdee..8621446 100644 --- a/__TESTS__/unit/fromJson/backgroundRemoval.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/backgroundRemoval.fromJson.test.ts @@ -1,24 +1,35 @@ -import {fromJson} from "../../../src/internal/fromJson"; -import {ForegroundObject} from "../../../src/qualifiers/foregroundObject"; +import { fromJson } from "../../../src/internal/fromJson"; +import { ForegroundObject } from "../../../src/qualifiers/foregroundObject"; -describe('backgroundRemoval.fromJson', () => { - it('should generate a url with backgroundRemoval', function () { - const transformation = fromJson({actions:[ - { actionType: 'backgroundRemoval'}, - { actionType: 'backgroundRemoval', fineEdges: true}, - { actionType: 'backgroundRemoval', fineEdges: false}, - { actionType: 'backgroundRemoval', hints: []}, - { actionType: 'backgroundRemoval', hints: [ForegroundObject.DOG, ForegroundObject.CAT]}, - { actionType: 'backgroundRemoval', fineEdges: true, hints: [ForegroundObject.DOG, ForegroundObject.CAT]}, - ]}); +describe("backgroundRemoval.fromJson", () => { + it("should generate a url with backgroundRemoval", function () { + const transformation = fromJson({ + actions: [ + { actionType: "backgroundRemoval" }, + { actionType: "backgroundRemoval", fineEdges: true }, + { actionType: "backgroundRemoval", fineEdges: false }, + { actionType: "backgroundRemoval", hints: [] }, + { + actionType: "backgroundRemoval", + hints: [ForegroundObject.DOG, ForegroundObject.CAT], + }, + { + actionType: "backgroundRemoval", + fineEdges: true, + hints: [ForegroundObject.DOG, ForegroundObject.CAT], + }, + ], + }); - expect(transformation.toString()).toStrictEqual([ - 'e_background_removal', - 'e_background_removal:fineedges_y', - 'e_background_removal:fineedges_n', - 'e_background_removal', - 'e_background_removal:hints_(dog;cat)', - 'e_background_removal:fineedges_y:hints_(dog;cat)', - ].join('/')); + expect(transformation.toString()).toStrictEqual( + [ + "e_background_removal", + "e_background_removal:fineedges_y", + "e_background_removal:fineedges_n", + "e_background_removal", + "e_background_removal:hints_(dog;cat)", + "e_background_removal:fineedges_y:hints_(dog;cat)", + ].join("/") + ); }); }); diff --git a/__TESTS__/unit/fromJson/border.fromJson.test.ts b/__TESTS__/unit/fromJson/border.fromJson.test.ts index 7b17be3..edb766f 100644 --- a/__TESTS__/unit/fromJson/border.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/border.fromJson.test.ts @@ -1,30 +1,30 @@ -import {fromJson} from "../../../src/internal/fromJson"; +import { fromJson } from "../../../src/internal/fromJson"; -describe('border.fromJson', () => { - it('should generate a url with border from array of models', function () { - const transformation = fromJson({actions: - [ { - actionType: 'border', +describe("border.fromJson", () => { + it("should generate a url with border from array of models", function () { + const transformation = fromJson({ + actions: [ + { + actionType: "border", width: 5, - color: 'red', + color: "red", }, { - actionType: 'border', + actionType: "border", width: 5, - color: 'red', - radius: [10, 20, 30, 40] + color: "red", + radius: [10, 20, 30, 40], }, { - actionType: 'border', + actionType: "border", width: 10, - color: 'blue', - radius: 'max' + color: "blue", + radius: "max", }, - ]} - ); + ], + }); expect(transformation.toString()).toStrictEqual( - 'bo_5px_solid_red/bo_5px_solid_red,r_10:20:30:40/bo_10px_solid_blue,r_max' + "bo_5px_solid_red/bo_5px_solid_red,r_10:20:30:40/bo_10px_solid_blue,r_max" ); }); }); - diff --git a/__TESTS__/unit/fromJson/concatenate.fromJson.test.ts b/__TESTS__/unit/fromJson/concatenate.fromJson.test.ts index 85bf727..02ee613 100644 --- a/__TESTS__/unit/fromJson/concatenate.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/concatenate.fromJson.test.ts @@ -1,93 +1,92 @@ -import {fromJson} from "../../../src/internal/fromJson"; -import {IConcatenateActionModel} from "../../../src/internal/models/IConcatenateActionModel"; +import { fromJson } from "../../../src/internal/fromJson"; +import { IConcatenateActionModel } from "../../../src/internal/models/IConcatenateActionModel"; -describe('concatenate.fromJson', () => { - it('Should generate ConcatenateAction from model', () => { +describe("concatenate.fromJson", () => { + it("Should generate ConcatenateAction from model", () => { const concatenateModel: IConcatenateActionModel = { - actionType: 'concatenate', + actionType: "concatenate", source: { - sourceType: 'video', - publicId: 'dog' + sourceType: "video", + publicId: "dog", }, prepend: true, - duration: 1 + duration: 1, }; - const transformation = fromJson({actions: [concatenateModel]}); + const transformation = fromJson({ actions: [concatenateModel] }); - expect(transformation.toString()).toStrictEqual('du_1,fl_splice,l_video:dog/fl_layer_apply,so_0'); + expect(transformation.toString()).toStrictEqual("du_1,fl_splice,l_video:dog/fl_layer_apply,so_0"); }); - it('Should generate ConcatenateAction with transition from model', () => { + it("Should generate ConcatenateAction with transition from model", () => { const concatenateModel: IConcatenateActionModel = { - actionType: 'concatenate', + actionType: "concatenate", source: { - sourceType: 'video', - publicId: 'dog', + sourceType: "video", + publicId: "dog", transformation: { - actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: 7}} - ] - } + actions: [{ actionType: "scale", dimensions: { width: 100, aspectRatio: 7 } }], + }, }, prepend: true, duration: 1, transition: { - - sourceType: 'video', - publicId: 'cat' - } + sourceType: "video", + publicId: "cat", + }, }; - const transformation = fromJson({actions: [concatenateModel]}); - expect(transformation.toString()).toStrictEqual('du_1,l_video:dog/ar_7.0,c_scale,w_100/e_transition,l_video:cat/fl_layer_apply/fl_layer_apply,so_0'); + const transformation = fromJson({ actions: [concatenateModel] }); + expect(transformation.toString()).toStrictEqual( + "du_1,l_video:dog/ar_7.0,c_scale,w_100/e_transition,l_video:cat/fl_layer_apply/fl_layer_apply,so_0" + ); }); - it('Should generate ConcatenateAction with ImageSource and transition from model', () => { + it("Should generate ConcatenateAction with ImageSource and transition from model", () => { const concatenateModel: IConcatenateActionModel = { - actionType: 'concatenate', + actionType: "concatenate", source: { - sourceType: 'image', - publicId: 'dog', + sourceType: "image", + publicId: "dog", transformation: { - actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: 7}} - ] - } + actions: [{ actionType: "scale", dimensions: { width: 100, aspectRatio: 7 } }], + }, }, prepend: true, duration: 1, transition: { - - sourceType: 'video', - publicId: 'cat' - } + sourceType: "video", + publicId: "cat", + }, }; - const transformation = fromJson({actions: [concatenateModel]}); + const transformation = fromJson({ actions: [concatenateModel] }); - expect(transformation.toString()).toStrictEqual('du_1,l_dog/ar_7.0,c_scale,w_100/e_transition,l_video:cat/fl_layer_apply/fl_layer_apply,so_0'); + expect(transformation.toString()).toStrictEqual( + "du_1,l_dog/ar_7.0,c_scale,w_100/e_transition,l_video:cat/fl_layer_apply/fl_layer_apply,so_0" + ); }); - it('Should generate ConcatenateAction with FetchSource and transition from model', () => { + it("Should generate ConcatenateAction with FetchSource and transition from model", () => { const concatenateModel: IConcatenateActionModel = { - actionType: 'concatenate', + actionType: "concatenate", source: { - sourceType: 'fetch', - url: 'https://example.com', - format: 'jpg' + sourceType: "fetch", + url: "https://example.com", + format: "jpg", }, prepend: true, duration: 1, transition: { - - sourceType: 'video', - publicId: 'cat' - } + sourceType: "video", + publicId: "cat", + }, }; - const transformation = fromJson({actions: [concatenateModel]}); + const transformation = fromJson({ actions: [concatenateModel] }); - expect(transformation.toString()).toStrictEqual('du_1,l_fetch:aHR0cHM6Ly9leGFtcGxlLmNvbQ==.jpg/e_transition,l_video:cat/fl_layer_apply/fl_layer_apply,so_0'); + expect(transformation.toString()).toStrictEqual( + "du_1,l_fetch:aHR0cHM6Ly9leGFtcGxlLmNvbQ==.jpg/e_transition,l_video:cat/fl_layer_apply/fl_layer_apply,so_0" + ); }); }); diff --git a/__TESTS__/unit/fromJson/condition.fromJson.test.ts b/__TESTS__/unit/fromJson/condition.fromJson.test.ts index 8c794af..0592a8e 100644 --- a/__TESTS__/unit/fromJson/condition.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/condition.fromJson.test.ts @@ -1,37 +1,37 @@ -import {fromJson} from "../../../src/internal/fromJson"; -import {Transformation} from "../../../src"; -import {Resize} from "../../../src/actions/resize"; +import { fromJson } from "../../../src/internal/fromJson"; +import { Transformation } from "../../../src"; +import { Resize } from "../../../src/actions/resize"; -describe('condition.fromJson', () => { - it('should generate a transformation string from condition action', function () { - const widthTx = new Transformation().addAction('w_100'); +describe("condition.fromJson", () => { + it("should generate a transformation string from condition action", function () { + const widthTx = new Transformation().addAction("w_100"); const transformation = fromJson({ actions: [ { - actionType: 'ifCondition', - expression: 'ar >= 1.0', - transformation: widthTx - } - ] + actionType: "ifCondition", + expression: "ar >= 1.0", + transformation: widthTx, + }, + ], }); - expect(transformation.toString()).toStrictEqual('if_ar_gte_1.0/w_100/if_end'); + expect(transformation.toString()).toStrictEqual("if_ar_gte_1.0/w_100/if_end"); }); - it('should generate a transformation string from condition action with otherwise', function () { - const widthTx = new Transformation().addAction('w_100'); + it("should generate a transformation string from condition action with otherwise", function () { + const widthTx = new Transformation().addAction("w_100"); const otherwiseTx = new Transformation().resize(Resize.scale(50)); const transformation = fromJson({ actions: [ { - actionType: 'ifCondition', - expression: 'ar >= 1.0', + actionType: "ifCondition", + expression: "ar >= 1.0", transformation: widthTx, - otherwise: otherwiseTx - } - ] + otherwise: otherwiseTx, + }, + ], }); - expect(transformation.toString()).toStrictEqual('if_ar_gte_1.0/w_100/if_else/c_scale,w_50/if_end'); + expect(transformation.toString()).toStrictEqual("if_ar_gte_1.0/w_100/if_else/c_scale,w_50/if_end"); }); -}); \ No newline at end of file +}); diff --git a/__TESTS__/unit/fromJson/delivery.fromJson.test.ts b/__TESTS__/unit/fromJson/delivery.fromJson.test.ts index ec8368d..d3d7b8d 100644 --- a/__TESTS__/unit/fromJson/delivery.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/delivery.fromJson.test.ts @@ -1,174 +1,202 @@ -import {fromJson} from "../../../src/internal/fromJson"; +import { fromJson } from "../../../src/internal/fromJson"; -describe('delivery.fromJson', () => { - it('should generate a transformation string from colorSpace action', function () { - const transformation = fromJson({actions:[ - {actionType: 'colorSpace', mode: 'srgbTrueColor'} - ]}); - - expect(transformation.toString()).toStrictEqual('cs_srgb:truecolor'); - }); - - it('should generate a transformation string from colorSpaceFromIcc action', function () { - const transformation = fromJson({actions:[ - {actionType: 'colorSpaceFromICC', publicId: 'sample'} - ]}); - - expect(transformation.toString()).toStrictEqual('cs_icc:sample'); - }); - - it('jpg.progressive.semi()', () => { - const transformation = fromJson({actions:[ - { - progressive: { mode: 'semi' }, - actionType: 'format', - formatType: 'jpg' - } - ]}); - - expect(transformation.toString()).toStrictEqual('f_jpg,fl_progressive:semi'); - }); - - it('gif.lossy()', () => { - const transformation = fromJson({actions:[ - { - actionType: 'format', - formatType: 'gif', - lossy: true - } - ]}); - - expect(transformation.toString()).toStrictEqual('f_gif,fl_lossy'); - }); - - it('quality:80', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: '80' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_80'); - }); - - it('quality:80.quantization', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: '80', - quantization: 10 - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_80:qmax_10'); - }); - - it('quality:auto', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: 'auto' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_auto'); - }); - - it('quality:auto:best', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: 'autoBest' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_auto:best'); - }); - - it('quality:auto:eco', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: 'autoEco' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_auto:eco'); - }); - - it('quality:auto:good', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: 'autoGood' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_auto:good'); - }); - - it('quality:auto:low', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: 'autoLow' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_auto:low'); - }); - - it('quality:jpegminiHigh', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: 'jpegminiHigh' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_jpegmini:1'); - }); - - it('quality:jpegminiMedium', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: 'jpegminiMedium' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_jpegmini:2'); - }); - - it('quality:jpegminiBest', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: 'jpegminiBest' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_jpegmini:0'); - }); - - it('chromaSubSampling', () => { - const transformation = fromJson({actions:[ - { - actionType: 'quality', - level: '75', - chromaSubSampling: 'CHROMA_420' - } - ]}); - - expect(transformation.toString()).toStrictEqual('q_75:420'); - }); - - it('dpr', () => { - const transformation = fromJson({actions:[ - { actionType: 'dpr', dpr: 'auto'}, - { actionType: 'dpr', dpr: 2}, - ]}); - expect(transformation.toString()).toStrictEqual('dpr_auto/dpr_2.0'); +describe("delivery.fromJson", () => { + it("should generate a transformation string from colorSpace action", function () { + const transformation = fromJson({ + actions: [{ actionType: "colorSpace", mode: "srgbTrueColor" }], + }); + + expect(transformation.toString()).toStrictEqual("cs_srgb:truecolor"); + }); + + it("should generate a transformation string from colorSpaceFromIcc action", function () { + const transformation = fromJson({ + actions: [{ actionType: "colorSpaceFromICC", publicId: "sample" }], + }); + + expect(transformation.toString()).toStrictEqual("cs_icc:sample"); + }); + + it("jpg.progressive.semi()", () => { + const transformation = fromJson({ + actions: [ + { + progressive: { mode: "semi" }, + actionType: "format", + formatType: "jpg", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("f_jpg,fl_progressive:semi"); + }); + + it("gif.lossy()", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "format", + formatType: "gif", + lossy: true, + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("f_gif,fl_lossy"); + }); + + it("quality:80", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "80", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_80"); + }); + + it("quality:80.quantization", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "80", + quantization: 10, + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_80:qmax_10"); + }); + + it("quality:auto", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "auto", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_auto"); + }); + + it("quality:auto:best", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "autoBest", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_auto:best"); + }); + + it("quality:auto:eco", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "autoEco", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_auto:eco"); + }); + + it("quality:auto:good", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "autoGood", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_auto:good"); + }); + + it("quality:auto:low", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "autoLow", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_auto:low"); + }); + + it("quality:jpegminiHigh", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "jpegminiHigh", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_jpegmini:1"); + }); + + it("quality:jpegminiMedium", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "jpegminiMedium", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_jpegmini:2"); + }); + + it("quality:jpegminiBest", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "jpegminiBest", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_jpegmini:0"); + }); + + it("chromaSubSampling", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "quality", + level: "75", + chromaSubSampling: "CHROMA_420", + }, + ], + }); + + expect(transformation.toString()).toStrictEqual("q_75:420"); + }); + + it("dpr", () => { + const transformation = fromJson({ + actions: [ + { actionType: "dpr", dpr: "auto" }, + { actionType: "dpr", dpr: 2 }, + ], + }); + expect(transformation.toString()).toStrictEqual("dpr_auto/dpr_2.0"); }); }); diff --git a/__TESTS__/unit/fromJson/effect.fromJson.test.ts b/__TESTS__/unit/fromJson/effect.fromJson.test.ts index 693bc7c..cd5b2b7 100644 --- a/__TESTS__/unit/fromJson/effect.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/effect.fromJson.test.ts @@ -1,81 +1,98 @@ -import {fromJson} from "../../../src/internal/fromJson"; +import { fromJson } from "../../../src/internal/fromJson"; -describe('effect.fromJson', () => { - it('should generate a url with resize actions from array of models', function () { - const transformation = fromJson({actions:[ - { actionType: 'sepia' }, - { actionType: 'boomerang' }, - { actionType: 'grayscale' }, - { actionType: 'advancedRedEye' }, - { actionType: 'negate' }, - { actionType: 'redEye' }, - { actionType: 'reverse' }, - { actionType: 'transition' }, - { actionType: 'shadow', offsetX: 5, color: 'red'}, - { actionType: 'colorize', level: 10, color: 'red' }, - { actionType: 'oilPaint', level: 8 }, - { actionType: 'cartoonify', colorReductionLevel: 80, lineStrength: 70 }, - { actionType: 'outline', width: 100, color: 'lightblue' }, - { actionType: 'blackwhite', level: 40 }, - { actionType: 'accelerate', rate: 10 }, - { actionType: 'loop', iterations: 5 }, - { actionType: 'makeTransparent', tolerance: 5, color: 'red' }, - { actionType: 'noise', level: 50 }, - { actionType: 'vignette', level: 5 }, - { actionType: 'dither', type: 9 }, - { actionType: 'vectorize', numOfColors: 17, detailLevel: 100 }, - { actionType: 'gradientFade', strength: 5, horizontalStartPoint: 10, verticalStartPoint: 20 }, - { actionType: 'assistColorblind', type: 'stripes', stripesStrength: 20 }, - { actionType: 'assistColorblind', type: 'xray' }, - { actionType: 'simulateColorblind', condition: 'rod_monochromacy' }, - { actionType: 'deshake', pixels: 16 }, - { actionType: 'pixelate', squareSize: 15, region: { RegionType: 'faces' }}, - { actionType: 'blur', strength: 5 }, - { actionType: 'fadeIn', length: 13 }, - { actionType: 'fadeOut', length: 13 }, - { actionType: 'fadeIn' }, - { actionType: 'fadeOut' }, - { actionType: 'dropshadow' }, - { actionType: 'dropshadow', azimuth: 20 }, - { actionType: 'dropshadow', spread: 30, elevation: 20, azimuth: 60 } - ]}); +describe("effect.fromJson", () => { + it("should generate a url with resize actions from array of models", function () { + const transformation = fromJson({ + actions: [ + { actionType: "sepia" }, + { actionType: "boomerang" }, + { actionType: "grayscale" }, + { actionType: "advancedRedEye" }, + { actionType: "negate" }, + { actionType: "redEye" }, + { actionType: "reverse" }, + { actionType: "transition" }, + { actionType: "shadow", offsetX: 5, color: "red" }, + { actionType: "colorize", level: 10, color: "red" }, + { actionType: "oilPaint", level: 8 }, + { actionType: "cartoonify", colorReductionLevel: 80, lineStrength: 70 }, + { actionType: "outline", width: 100, color: "lightblue" }, + { actionType: "blackwhite", level: 40 }, + { actionType: "accelerate", rate: 10 }, + { actionType: "loop", iterations: 5 }, + { actionType: "makeTransparent", tolerance: 5, color: "red" }, + { actionType: "noise", level: 50 }, + { actionType: "vignette", level: 5 }, + { actionType: "dither", type: 9 }, + { actionType: "vectorize", numOfColors: 17, detailLevel: 100 }, + { + actionType: "gradientFade", + strength: 5, + horizontalStartPoint: 10, + verticalStartPoint: 20, + }, + { + actionType: "assistColorblind", + type: "stripes", + stripesStrength: 20, + }, + { actionType: "assistColorblind", type: "xray" }, + { actionType: "simulateColorblind", condition: "rod_monochromacy" }, + { actionType: "deshake", pixels: 16 }, + { + actionType: "pixelate", + squareSize: 15, + region: { RegionType: "faces" }, + }, + { actionType: "blur", strength: 5 }, + { actionType: "fadeIn", length: 13 }, + { actionType: "fadeOut", length: 13 }, + { actionType: "fadeIn" }, + { actionType: "fadeOut" }, + { actionType: "dropshadow" }, + { actionType: "dropshadow", azimuth: 20 }, + { actionType: "dropshadow", spread: 30, elevation: 20, azimuth: 60 }, + ], + }); - expect(transformation.toString()).toStrictEqual([ - 'e_sepia', - 'e_boomerang', - 'e_grayscale', - 'e_adv_redeye', - 'e_negate', - 'e_redeye', - 'e_reverse', - 'e_transition', - 'co_red,e_shadow,x_5', - 'co_red,e_colorize:10', - 'e_oil_paint:8', - 'e_cartoonify:70:80', - 'co_lightblue,e_outline:100', - 'e_blackwhite:40', - 'e_accelerate:10', - 'e_loop:5', - 'co_red,e_make_transparent:5', - 'e_noise:50', - 'e_vignette:5', - 'e_dither:9', - 'e_vectorize:colors:17:detail:100', - 'e_gradient_fade:5,x_10,y_20', - 'e_assist_colorblind:20', - 'e_assist_colorblind:xray', - 'e_simulate_colorblind:rod_monochromacy', - 'e_deshake:16', - 'e_pixelate_faces:15', - 'e_blur:5', - 'e_fade:13', - 'e_fade:-13', - 'e_fade:1000', - 'e_fade:-1000', - 'e_dropshadow', - 'e_dropshadow:azimuth_20', - 'e_dropshadow:azimuth_60;elevation_20;spread_30', - ].join('/')); + expect(transformation.toString()).toStrictEqual( + [ + "e_sepia", + "e_boomerang", + "e_grayscale", + "e_adv_redeye", + "e_negate", + "e_redeye", + "e_reverse", + "e_transition", + "co_red,e_shadow,x_5", + "co_red,e_colorize:10", + "e_oil_paint:8", + "e_cartoonify:70:80", + "co_lightblue,e_outline:100", + "e_blackwhite:40", + "e_accelerate:10", + "e_loop:5", + "co_red,e_make_transparent:5", + "e_noise:50", + "e_vignette:5", + "e_dither:9", + "e_vectorize:colors:17:detail:100", + "e_gradient_fade:5,x_10,y_20", + "e_assist_colorblind:20", + "e_assist_colorblind:xray", + "e_simulate_colorblind:rod_monochromacy", + "e_deshake:16", + "e_pixelate_faces:15", + "e_blur:5", + "e_fade:13", + "e_fade:-13", + "e_fade:1000", + "e_fade:-1000", + "e_dropshadow", + "e_dropshadow:azimuth_20", + "e_dropshadow:azimuth_60;elevation_20;spread_30", + ].join("/") + ); }); }); diff --git a/__TESTS__/unit/fromJson/fromJson.test.ts b/__TESTS__/unit/fromJson/fromJson.test.ts index 2f085e9..d9348cf 100644 --- a/__TESTS__/unit/fromJson/fromJson.test.ts +++ b/__TESTS__/unit/fromJson/fromJson.test.ts @@ -1,13 +1,17 @@ -import {fromJson} from "../../../src/internal/fromJson"; -import {createUnsupportedError} from "../../../src/internal/utils/unsupportedError"; +import { fromJson } from "../../../src/internal/fromJson"; +import { createUnsupportedError } from "../../../src/internal/utils/unsupportedError"; -describe('fromJson', () => { - it('should generate an error for array that includes an unsupported action', function () { - const transformation = fromJson({actions:[ - {actionType: 'unsupported', dimensions: {width: 100}}, - {actionType: 'scale', dimensions: {height: 200}, relative: true} - ]}); +describe("fromJson", () => { + it("should generate an error for array that includes an unsupported action", function () { + const transformation = fromJson({ + actions: [ + { actionType: "unsupported", dimensions: { width: 100 } }, + { actionType: "scale", dimensions: { height: 200 }, relative: true }, + ], + }); - expect(transformation).toStrictEqual({error: createUnsupportedError('unsupported action unsupported')}); + expect(transformation).toStrictEqual({ + error: createUnsupportedError("unsupported action unsupported"), + }); }); }); diff --git a/__TESTS__/unit/fromJson/overlayUnderlay.fromJson.test.ts b/__TESTS__/unit/fromJson/overlayUnderlay.fromJson.test.ts index 34a0295..fd2ad51 100644 --- a/__TESTS__/unit/fromJson/overlayUnderlay.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/overlayUnderlay.fromJson.test.ts @@ -1,174 +1,193 @@ -import {IOverlayActionModel} from "../../../src/internal/models/IOverlayActionModel"; -import {fromJson} from "../../../src/internal/fromJson"; -import {IImageSourceModel} from "../../../src/internal/models/IImageSourceModel"; -import {IPositionModel} from "../../../src/internal/models/IPositionModel"; -import {ITimelinePositionModel} from "../../../src/internal/models/ITimelinePositionModel"; -import {ITextSourceModel} from "../../../src/internal/models/ITextSourceModel"; -import {IFetchSourceModel} from "../../../src/internal/models/IFetchSourceModel"; -import {IVideoSourceModel} from "../../../src/internal/models/IVideoSourceModel"; +import { IOverlayActionModel } from "../../../src/internal/models/IOverlayActionModel"; +import { fromJson } from "../../../src/internal/fromJson"; +import { IImageSourceModel } from "../../../src/internal/models/IImageSourceModel"; +import { IPositionModel } from "../../../src/internal/models/IPositionModel"; +import { ITimelinePositionModel } from "../../../src/internal/models/ITimelinePositionModel"; +import { ITextSourceModel } from "../../../src/internal/models/ITextSourceModel"; +import { IFetchSourceModel } from "../../../src/internal/models/IFetchSourceModel"; +import { IVideoSourceModel } from "../../../src/internal/models/IVideoSourceModel"; const position: IPositionModel = { offsetX: 1, offsetY: 2, tiled: true, allowOverflow: true, - gravity: {gravityType: 'direction', compass: 'north_east'} + gravity: { gravityType: "direction", compass: "north_east" }, }; -describe('Overlay & Underlay fromJson', () => { - it('Should generate Overlay for image source', () => { +describe("Overlay & Underlay fromJson", () => { + it("Should generate Overlay for image source", () => { const source: IImageSourceModel = { - sourceType: 'image', - publicId: 'sample', + sourceType: "image", + publicId: "sample", transformation: { - actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: 7}} - ] - } + actions: [{ actionType: "scale", dimensions: { width: 100, aspectRatio: 7 } }], + }, }; const overlayModel: IOverlayActionModel = { - actionType: 'overlay', + actionType: "overlay", source, position, - blendMode: {blendModeType: 'multiply'} + blendMode: { blendModeType: "multiply" }, }; - const overlayTransformation = fromJson({actions: [overlayModel]}); - const underlayTransformation = fromJson({actions: [{...overlayModel, actionType: 'underlay'}]}); - - expect(overlayTransformation.toString()).toStrictEqual('l_sample/ar_7.0,c_scale,w_100/e_multiply,fl_layer_apply,fl_tiled,g_north_east,x_1,y_2'); - expect(underlayTransformation.toString()).toStrictEqual('u_sample/ar_7.0,c_scale,w_100/e_multiply,fl_layer_apply,fl_tiled,g_north_east,x_1,y_2'); + const overlayTransformation = fromJson({ actions: [overlayModel] }); + const underlayTransformation = fromJson({ + actions: [{ ...overlayModel, actionType: "underlay" }], + }); + + expect(overlayTransformation.toString()).toStrictEqual( + "l_sample/ar_7.0,c_scale,w_100/e_multiply,fl_layer_apply,fl_tiled,g_north_east,x_1,y_2" + ); + expect(underlayTransformation.toString()).toStrictEqual( + "u_sample/ar_7.0,c_scale,w_100/e_multiply,fl_layer_apply,fl_tiled,g_north_east,x_1,y_2" + ); }); - it('Should generate Overlay for video source', () => { + it("Should generate Overlay for video source", () => { const source: IVideoSourceModel = { - sourceType: 'video', - publicId: 'dog.mp4', + sourceType: "video", + publicId: "dog.mp4", transformation: { - actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: 7}} - ] - } + actions: [{ actionType: "scale", dimensions: { width: 100, aspectRatio: 7 } }], + }, }; const timelinePosition: ITimelinePositionModel = { startOffset: 1, - duration: 2 + duration: 2, }; const overlayModel: IOverlayActionModel = { - actionType: 'overlay', + actionType: "overlay", source, position, timelinePosition, - blendMode: {blendModeType: 'antiRemoval', level: '96'} + blendMode: { blendModeType: "antiRemoval", level: "96" }, }; - const overlayTransformation = fromJson({actions: [overlayModel]}); - const underlayTransformation = fromJson({actions: [{...overlayModel, actionType: 'underlay'}]}); - - expect(overlayTransformation.toString()).toStrictEqual('l_video:dog.mp4/ar_7.0,c_scale,w_100/du_2,e_anti_removal:96,fl_layer_apply,fl_tiled,g_north_east,so_1,x_1,y_2'); - expect(underlayTransformation.toString()).toStrictEqual('u_video:dog.mp4/ar_7.0,c_scale,w_100/du_2,e_anti_removal:96,fl_layer_apply,fl_tiled,g_north_east,so_1,x_1,y_2'); + const overlayTransformation = fromJson({ actions: [overlayModel] }); + const underlayTransformation = fromJson({ + actions: [{ ...overlayModel, actionType: "underlay" }], + }); + + expect(overlayTransformation.toString()).toStrictEqual( + "l_video:dog.mp4/ar_7.0,c_scale,w_100/du_2,e_anti_removal:96,fl_layer_apply,fl_tiled,g_north_east,so_1,x_1,y_2" + ); + expect(underlayTransformation.toString()).toStrictEqual( + "u_video:dog.mp4/ar_7.0,c_scale,w_100/du_2,e_anti_removal:96,fl_layer_apply,fl_tiled,g_north_east,so_1,x_1,y_2" + ); }); - it('Should generate Overlay for fetch source', () => { + it("Should generate Overlay for fetch source", () => { const source: IFetchSourceModel = { - sourceType: 'fetch', - url: 'https://some/image.jpg', + sourceType: "fetch", + url: "https://some/image.jpg", transformation: { - actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: 7}} - ] - } + actions: [{ actionType: "scale", dimensions: { width: 100, aspectRatio: 7 } }], + }, }; - const overlayModel: IOverlayActionModel = { - actionType: 'overlay', + actionType: "overlay", source, position, - blendMode: {blendModeType: 'antiRemoval'} + blendMode: { blendModeType: "antiRemoval" }, }; - const overlayTransformation = fromJson({actions: [overlayModel]}); - const underlayTransformation = fromJson({actions: [{...overlayModel, actionType: 'underlay'}]}); - - expect(overlayTransformation.toString()).toStrictEqual('l_fetch:aHR0cHM6Ly9zb21lL2ltYWdlLmpwZw==/ar_7.0,c_scale,w_100/e_anti_removal,fl_layer_apply,fl_tiled,g_north_east,x_1,y_2'); - expect(underlayTransformation.toString()).toStrictEqual('u_fetch:aHR0cHM6Ly9zb21lL2ltYWdlLmpwZw==/ar_7.0,c_scale,w_100/e_anti_removal,fl_layer_apply,fl_tiled,g_north_east,x_1,y_2'); + const overlayTransformation = fromJson({ actions: [overlayModel] }); + const underlayTransformation = fromJson({ + actions: [{ ...overlayModel, actionType: "underlay" }], + }); + + expect(overlayTransformation.toString()).toStrictEqual( + "l_fetch:aHR0cHM6Ly9zb21lL2ltYWdlLmpwZw==/ar_7.0,c_scale,w_100/e_anti_removal,fl_layer_apply,fl_tiled,g_north_east,x_1,y_2" + ); + expect(underlayTransformation.toString()).toStrictEqual( + "u_fetch:aHR0cHM6Ly9zb21lL2ltYWdlLmpwZw==/ar_7.0,c_scale,w_100/e_anti_removal,fl_layer_apply,fl_tiled,g_north_east,x_1,y_2" + ); }); - it('Should generate Overlay for text source', () => { + it("Should generate Overlay for text source", () => { const source: ITextSourceModel = { - sourceType: 'text', - text: 'example', + sourceType: "text", + text: "example", textStyle: { - fontFamily: 'arial', + fontFamily: "arial", fontSize: 1, - fontWeight: 'bold', - fontStyle: 'italic', - fontAntialias: 'fast', - fontHinting: 'slight', - textDecoration: 'strikethrough', - textAlignment: 'center', - stroke: {width: 2, color: 'white'}, + fontWeight: "bold", + fontStyle: "italic", + fontAntialias: "fast", + fontHinting: "slight", + textDecoration: "strikethrough", + textAlignment: "center", + stroke: { width: 2, color: "white" }, letterSpacing: 2.3, - lineSpacing: 3.2 + lineSpacing: 3.2, }, - textColor: 'red', - backgroundColor: 'blue', + textColor: "red", + backgroundColor: "blue", transformation: { - actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: 7}} - ] - } + actions: [{ actionType: "scale", dimensions: { width: 100, aspectRatio: 7 } }], + }, }; const overlayModel: IOverlayActionModel = { - actionType: 'overlay', + actionType: "overlay", source, }; - const overlayTransformation = fromJson({actions: [overlayModel]}); - const underlayTransformation = fromJson({actions: [{...overlayModel, actionType: 'underlay'}]}); - expect(overlayTransformation.toString()).toStrictEqual('b_blue,co_red,l_text:arial_1_bold_italic_strikethrough_center_stroke_bo_2px_solid_white_letter_spacing_2.3_line_spacing_3.2_antialias_fast_hinting_slight:example/ar_7.0,c_scale,w_100/fl_layer_apply'); - expect(underlayTransformation.toString()).toStrictEqual('b_blue,co_red,u_text:arial_1_bold_italic_strikethrough_center_stroke_bo_2px_solid_white_letter_spacing_2.3_line_spacing_3.2_antialias_fast_hinting_slight:example/ar_7.0,c_scale,w_100/fl_layer_apply'); + const overlayTransformation = fromJson({ actions: [overlayModel] }); + const underlayTransformation = fromJson({ + actions: [{ ...overlayModel, actionType: "underlay" }], + }); + expect(overlayTransformation.toString()).toStrictEqual( + "b_blue,co_red,l_text:arial_1_bold_italic_strikethrough_center_stroke_bo_2px_solid_white_letter_spacing_2.3_line_spacing_3.2_antialias_fast_hinting_slight:example/ar_7.0,c_scale,w_100/fl_layer_apply" + ); + expect(underlayTransformation.toString()).toStrictEqual( + "b_blue,co_red,u_text:arial_1_bold_italic_strikethrough_center_stroke_bo_2px_solid_white_letter_spacing_2.3_line_spacing_3.2_antialias_fast_hinting_slight:example/ar_7.0,c_scale,w_100/fl_layer_apply" + ); }); - it('Should generate Overlay for subtitles source', () => { + it("Should generate Overlay for subtitles source", () => { const source: ITextSourceModel = { - sourceType: 'text', - text: 'example', + sourceType: "text", + text: "example", textStyle: { - fontFamily: 'arial', + fontFamily: "arial", fontSize: 1, - fontWeight: 'bold', - fontStyle: 'italic', - fontAntialias: 'fast', - fontHinting: 'slight', - textDecoration: 'strikethrough', - textAlignment: 'center', - stroke: {width: 2, color: 'white'}, + fontWeight: "bold", + fontStyle: "italic", + fontAntialias: "fast", + fontHinting: "slight", + textDecoration: "strikethrough", + textAlignment: "center", + stroke: { width: 2, color: "white" }, letterSpacing: 2.3, - lineSpacing: 3.2 + lineSpacing: 3.2, }, - textColor: 'red', - backgroundColor: 'blue', + textColor: "red", + backgroundColor: "blue", transformation: { - actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: 7}} - ] - } + actions: [{ actionType: "scale", dimensions: { width: 100, aspectRatio: 7 } }], + }, }; const overlayModel: IOverlayActionModel = { - actionType: 'overlay', + actionType: "overlay", source, }; - const overlayTransformation = fromJson({actions: [overlayModel]}); - const underlayTransformation = fromJson({actions: [{...overlayModel, actionType: 'underlay'}]}); - expect(overlayTransformation.toString()).toStrictEqual('b_blue,co_red,l_text:arial_1_bold_italic_strikethrough_center_stroke_bo_2px_solid_white_letter_spacing_2.3_line_spacing_3.2_antialias_fast_hinting_slight:example/ar_7.0,c_scale,w_100/fl_layer_apply'); - expect(underlayTransformation.toString()).toStrictEqual('b_blue,co_red,u_text:arial_1_bold_italic_strikethrough_center_stroke_bo_2px_solid_white_letter_spacing_2.3_line_spacing_3.2_antialias_fast_hinting_slight:example/ar_7.0,c_scale,w_100/fl_layer_apply'); + const overlayTransformation = fromJson({ actions: [overlayModel] }); + const underlayTransformation = fromJson({ + actions: [{ ...overlayModel, actionType: "underlay" }], + }); + expect(overlayTransformation.toString()).toStrictEqual( + "b_blue,co_red,l_text:arial_1_bold_italic_strikethrough_center_stroke_bo_2px_solid_white_letter_spacing_2.3_line_spacing_3.2_antialias_fast_hinting_slight:example/ar_7.0,c_scale,w_100/fl_layer_apply" + ); + expect(underlayTransformation.toString()).toStrictEqual( + "b_blue,co_red,u_text:arial_1_bold_italic_strikethrough_center_stroke_bo_2px_solid_white_letter_spacing_2.3_line_spacing_3.2_antialias_fast_hinting_slight:example/ar_7.0,c_scale,w_100/fl_layer_apply" + ); }); }); diff --git a/__TESTS__/unit/fromJson/preview.fromJson.test.ts b/__TESTS__/unit/fromJson/preview.fromJson.test.ts index 732d3a9..1df0a39 100644 --- a/__TESTS__/unit/fromJson/preview.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/preview.fromJson.test.ts @@ -1,17 +1,17 @@ -import {fromJson} from "../../../src/internal/fromJson"; -import {IPreviewActionModel} from "../../../src/internal/models/IPreviewActionModel"; +import { fromJson } from "../../../src/internal/fromJson"; +import { IPreviewActionModel } from "../../../src/internal/models/IPreviewActionModel"; -describe('videoEdit.preview fromJson', () => { - it('Should generate PreviewAction from model', () => { +describe("videoEdit.preview fromJson", () => { + it("Should generate PreviewAction from model", () => { const previewModel: IPreviewActionModel = { - actionType: 'preview', + actionType: "preview", duration: 5, maximumSegments: 10, - minimumSegmentDuration: 1 + minimumSegmentDuration: 1, }; - const transformation = fromJson({actions: [previewModel]}); + const transformation = fromJson({ actions: [previewModel] }); - expect(transformation.toString()).toStrictEqual('e_preview:duration_5.0:max_seg_10:min_seg_dur_1.0'); + expect(transformation.toString()).toStrictEqual("e_preview:duration_5.0:max_seg_10:min_seg_dur_1.0"); }); }); diff --git a/__TESTS__/unit/fromJson/resize.fromJson.test.ts b/__TESTS__/unit/fromJson/resize.fromJson.test.ts index 206d780..4cb8f21 100644 --- a/__TESTS__/unit/fromJson/resize.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/resize.fromJson.test.ts @@ -1,140 +1,265 @@ -import {fromJson} from "../../../src/internal/fromJson"; -import {scale} from "../../../src/actions/resize"; -import {Transformation} from '../../../src'; -import {IResizeAdvancedActionModel} from "../../../src/internal/models/IResizeAdvancedActionModel"; -import {ITransformationModel} from "../../../src/internal/models/ITransformationModel"; - -describe('resize.fromJson', () => { - it('should generate a url with resize actions from array of models', function () { - const transformation = fromJson({actions:[ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: 7}}, - {actionType: 'fit', dimensions: {height: 200, aspectRatio: '16:9'}, relative: true}, - {actionType: 'limitFit', dimensions: {height: 200, aspectRatio: 'ignore_aspect_ratio'}, relative: true}, - {actionType: 'minimumFit', dimensions: {width: 100}, regionRelative: true}, - {actionType: 'crop', dimensions: {width: 100}, regionRelative: true, gravity: {gravityType: 'direction', compass: 'north_east'}, y: 3, zoom: 7}, - {actionType: 'fill', dimensions: {width: 100}, relative: true, gravity: {gravityType: 'ocr'}, x: 4, y: 5}, - {actionType: 'limitFill', dimensions: {width: 100}, relative: true, gravity: {gravityType: 'direction', compass: 'south'}, x: 4, y: 5}, - {actionType: 'thumbnail', dimensions: {width: 100}, relative: true, gravity: {gravityType: 'direction', compass: 'south'}, zoom: 4}, - {actionType: 'pad', dimensions: {width: 100}, relative: true, gravity: {gravityType: 'direction', compass: 'south'}, x: 3, y:4}, - {actionType: 'limitPad', dimensions: {width: 100}, relative: true, gravity: {gravityType: 'direction', compass: 'south'}, x: 3, y:4}, - {actionType: 'minimumPad', dimensions: {width: 100}, relative: true, gravity: {gravityType: 'direction', compass: 'south'}, x: 3, y:4, background: {backgroundType: 'color', color: 'white'}}, - { - actionType: 'crop', - dimensions: {width: 200}, - gravity: { - gravityType: 'auto', - autoFocus: [ - {object: 'person', weight: 100}, - {object: 'cat', avoid: true} - ] - } - }, - { - actionType: 'crop', - dimensions: {width: 200}, - gravity: { - gravityType: 'object', - focusOnObjects: ['dog'], - fallbackGravity: { - gravityType: 'auto', +import { fromJson } from "../../../src/internal/fromJson"; +import { scale } from "../../../src/actions/resize"; +import { Transformation } from "../../../src"; +import { IResizeAdvancedActionModel } from "../../../src/internal/models/IResizeAdvancedActionModel"; +import { ITransformationModel } from "../../../src/internal/models/ITransformationModel"; + +describe("resize.fromJson", () => { + it("should generate a url with resize actions from array of models", function () { + const transformation = fromJson({ + actions: [ + { actionType: "scale", dimensions: { width: 100, aspectRatio: 7 } }, + { + actionType: "fit", + dimensions: { height: 200, aspectRatio: "16:9" }, + relative: true, + }, + { + actionType: "limitFit", + dimensions: { height: 200, aspectRatio: "ignore_aspect_ratio" }, + relative: true, + }, + { + actionType: "minimumFit", + dimensions: { width: 100 }, + regionRelative: true, + }, + { + actionType: "crop", + dimensions: { width: 100 }, + regionRelative: true, + gravity: { gravityType: "direction", compass: "north_east" }, + y: 3, + zoom: 7, + }, + { + actionType: "fill", + dimensions: { width: 100 }, + relative: true, + gravity: { gravityType: "ocr" }, + x: 4, + y: 5, + }, + { + actionType: "limitFill", + dimensions: { width: 100 }, + relative: true, + gravity: { gravityType: "direction", compass: "south" }, + x: 4, + y: 5, + }, + { + actionType: "thumbnail", + dimensions: { width: 100 }, + relative: true, + gravity: { gravityType: "direction", compass: "south" }, + zoom: 4, + }, + { + actionType: "pad", + dimensions: { width: 100 }, + relative: true, + gravity: { gravityType: "direction", compass: "south" }, + x: 3, + y: 4, + }, + { + actionType: "limitPad", + dimensions: { width: 100 }, + relative: true, + gravity: { gravityType: "direction", compass: "south" }, + x: 3, + y: 4, + }, + { + actionType: "minimumPad", + dimensions: { width: 100 }, + relative: true, + gravity: { gravityType: "direction", compass: "south" }, + x: 3, + y: 4, + background: { backgroundType: "color", color: "white" }, + }, + { + actionType: "crop", + dimensions: { width: 200 }, + gravity: { + gravityType: "auto", autoFocus: [ - {object: 'bird', weight: 30}, - {object: 'cat', avoid: true} - ] - } - } - }, - { - actionType: 'pad', - dimensions: {width: 200}, - background: { - backgroundType: 'generativeFill', - prompt: 'hello' - } - }, - { - actionType: 'minimumPad', - dimensions: {width: 200, aspectRatio: 7}, - background: { - backgroundType: 'generativeFill' - } - } - ]}); - - expect(transformation.toString()).toStrictEqual([ - 'ar_7.0,c_scale,w_100', - 'ar_16:9,c_fit,fl_relative,h_200', - 'c_limit,fl_ignore_aspect_ratio,fl_relative,h_200', - 'c_mfit,fl_region_relative,w_100', - 'c_crop,fl_region_relative,g_north_east,w_100,y_3,z_7', - 'c_fill,fl_relative,g_ocr_text,w_100,x_4,y_5', - 'c_lfill,fl_relative,g_south,w_100,x_4,y_5', - 'c_thumb,fl_relative,g_south,w_100,z_4', - 'c_pad,fl_relative,g_south,w_100,x_3,y_4', - 'c_lpad,fl_relative,g_south,w_100,x_3,y_4', - 'b_white,c_mpad,fl_relative,g_south,w_100,x_3,y_4', - 'c_crop,g_auto:person_100:cat_avoid,w_200', - 'c_crop,g_dog:auto:bird_30:cat_avoid,w_200', - 'b_gen_fill:prompt_hello,c_pad,w_200', - 'ar_7.0,b_gen_fill,c_mpad,w_200' - ].join('/')); + { object: "person", weight: 100 }, + { object: "cat", avoid: true }, + ], + }, + }, + { + actionType: "crop", + dimensions: { width: 200 }, + gravity: { + gravityType: "object", + focusOnObjects: ["dog"], + fallbackGravity: { + gravityType: "auto", + autoFocus: [ + { object: "bird", weight: 30 }, + { object: "cat", avoid: true }, + ], + }, + }, + }, + { + actionType: "pad", + dimensions: { width: 200 }, + background: { + backgroundType: "generativeFill", + prompt: "hello", + }, + }, + { + actionType: "minimumPad", + dimensions: { width: 200, aspectRatio: 7 }, + background: { + backgroundType: "generativeFill", + }, + }, + ], + }); + + expect(transformation.toString()).toStrictEqual( + [ + "ar_7.0,c_scale,w_100", + "ar_16:9,c_fit,fl_relative,h_200", + "c_limit,fl_ignore_aspect_ratio,fl_relative,h_200", + "c_mfit,fl_region_relative,w_100", + "c_crop,fl_region_relative,g_north_east,w_100,y_3,z_7", + "c_fill,fl_relative,g_ocr_text,w_100,x_4,y_5", + "c_lfill,fl_relative,g_south,w_100,x_4,y_5", + "c_thumb,fl_relative,g_south,w_100,z_4", + "c_pad,fl_relative,g_south,w_100,x_3,y_4", + "c_lpad,fl_relative,g_south,w_100,x_3,y_4", + "b_white,c_mpad,fl_relative,g_south,w_100,x_3,y_4", + "c_crop,g_auto:person_100:cat_avoid,w_200", + "c_crop,g_dog:auto:bird_30:cat_avoid,w_200", + "b_gen_fill:prompt_hello,c_pad,w_200", + "ar_7.0,b_gen_fill,c_mpad,w_200", + ].join("/") + ); }); - it('Should get original action when doing .toJson().fromJson()', ()=>{ - const transformation = new Transformation().addAction(scale('1.0')); + it("Should get original action when doing .toJson().fromJson()", () => { + const transformation = new Transformation().addAction(scale("1.0")); const json = transformation.toJson() as unknown as ITransformationModel; - expect((json.actions[0] as IResizeAdvancedActionModel).dimensions.width).toStrictEqual('1.0'); - expect(transformation.toString()).toStrictEqual('c_scale,w_1.0'); + expect((json.actions[0] as IResizeAdvancedActionModel).dimensions.width).toStrictEqual("1.0"); + expect(transformation.toString()).toStrictEqual("c_scale,w_1.0"); expect(transformation).toMatchObject(fromJson(json)); expect(transformation.toString()).toStrictEqual(fromJson(json).toString()); }); - it('Should generate AutoBackground from model', ()=>{ - const transformation = fromJson({actions: [ - {actionType: 'pad', dimensions: {width: 100}, background: {backgroundType: 'auto'}}, - ]}); + it("Should generate AutoBackground from model", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "pad", + dimensions: { width: 100 }, + background: { backgroundType: "auto" }, + }, + ], + }); - expect(transformation.toString()).toStrictEqual('b_auto,c_pad,w_100'); + expect(transformation.toString()).toStrictEqual("b_auto,c_pad,w_100"); }); - it('Should generate ColorBackground from model', ()=>{ - const transformation = fromJson({actions:[ - {actionType: 'pad', dimensions: {width: 100}, background: {backgroundType: 'color', color: 'red'}}, - ]}); + it("Should generate ColorBackground from model", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "pad", + dimensions: { width: 100 }, + background: { backgroundType: "color", color: "red" }, + }, + ], + }); - expect(transformation.toString()).toStrictEqual('b_red,c_pad,w_100'); + expect(transformation.toString()).toStrictEqual("b_red,c_pad,w_100"); }); - it('Should generate BorderBackground from model', ()=>{ - const transformation = fromJson({actions:[ - {actionType: 'pad', dimensions: {width: 100}, background: {backgroundType: 'border', contrast: true, palette: ['red', 'blue']}}, - ]}); + it("Should generate BorderBackground from model", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "pad", + dimensions: { width: 100 }, + background: { + backgroundType: "border", + contrast: true, + palette: ["red", "blue"], + }, + }, + ], + }); - expect(transformation.toString()).toStrictEqual('b_auto:border_contrast:palette_red_blue,c_pad,w_100'); + expect(transformation.toString()).toStrictEqual("b_auto:border_contrast:palette_red_blue,c_pad,w_100"); }); - it('Should generate BorderGradientBackground from model', ()=>{ - const transformation = fromJson({actions:[ - {actionType: 'pad', dimensions: {width: 100}, background: {backgroundType: 'borderGradient', contrast: true, palette: ['red', 'blue'], gradientColors: 4, gradientDirection: 'diagonal_desc'}}, - ]}); + it("Should generate BorderGradientBackground from model", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "pad", + dimensions: { width: 100 }, + background: { + backgroundType: "borderGradient", + contrast: true, + palette: ["red", "blue"], + gradientColors: 4, + gradientDirection: "diagonal_desc", + }, + }, + ], + }); - expect(transformation.toString()).toStrictEqual('b_auto:border_gradient_contrast:4:diagonal_desc:palette_red_blue,c_pad,w_100'); + expect(transformation.toString()).toStrictEqual( + "b_auto:border_gradient_contrast:4:diagonal_desc:palette_red_blue,c_pad,w_100" + ); }); - it('Should generate PredominantBackground from model', ()=>{ - const transformation = fromJson({actions: [ - {actionType: 'pad', dimensions: {width: 100}, background: {backgroundType: 'predominant', contrast: true, palette: ['red', 'blue']}}, - ]}); + it("Should generate PredominantBackground from model", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "pad", + dimensions: { width: 100 }, + background: { + backgroundType: "predominant", + contrast: true, + palette: ["red", "blue"], + }, + }, + ], + }); - expect(transformation.toString()).toStrictEqual('b_auto:predominant_contrast:palette_red_blue,c_pad,w_100'); + expect(transformation.toString()).toStrictEqual("b_auto:predominant_contrast:palette_red_blue,c_pad,w_100"); }); - it('Should generate PredominantGradientBackground from model', ()=>{ - const transformation = fromJson({actions: [ - {actionType: 'pad', dimensions: {width: 100}, background: {backgroundType: 'predominantGradient', contrast: true, palette: ['red', 'blue'], gradientColors: 4, gradientDirection: 'diagonal_desc'}}, - ]}); + it("Should generate PredominantGradientBackground from model", () => { + const transformation = fromJson({ + actions: [ + { + actionType: "pad", + dimensions: { width: 100 }, + background: { + backgroundType: "predominantGradient", + contrast: true, + palette: ["red", "blue"], + gradientColors: 4, + gradientDirection: "diagonal_desc", + }, + }, + ], + }); - expect(transformation.toString()).toStrictEqual('b_auto:predominant_gradient_contrast:4:diagonal_desc:palette_red_blue,c_pad,w_100'); + expect(transformation.toString()).toStrictEqual( + "b_auto:predominant_gradient_contrast:4:diagonal_desc:palette_red_blue,c_pad,w_100" + ); }); }); diff --git a/__TESTS__/unit/fromJson/rotate.fromJson.test.ts b/__TESTS__/unit/fromJson/rotate.fromJson.test.ts index 993617f..e8855a2 100644 --- a/__TESTS__/unit/fromJson/rotate.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/rotate.fromJson.test.ts @@ -1,17 +1,15 @@ -import {fromJson} from "../../../src/internal/fromJson"; +import { fromJson } from "../../../src/internal/fromJson"; -describe('rotate.fromJson', () => { - it('should generate a url with rotate actions from array of models', function () { - const transformation = fromJson({actions:[ - { - actionType: 'rotateByAngle', - angle: 4 - } - ]} - ); - expect(transformation.toString()).toStrictEqual( - 'a_4' - ); +describe("rotate.fromJson", () => { + it("should generate a url with rotate actions from array of models", function () { + const transformation = fromJson({ + actions: [ + { + actionType: "rotateByAngle", + angle: 4, + }, + ], + }); + expect(transformation.toString()).toStrictEqual("a_4"); }); }); - diff --git a/__TESTS__/unit/fromJson/roundCorners.fromJson.test.ts b/__TESTS__/unit/fromJson/roundCorners.fromJson.test.ts index 080a68d..21d1fe8 100644 --- a/__TESTS__/unit/fromJson/roundCorners.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/roundCorners.fromJson.test.ts @@ -1,26 +1,23 @@ -import {fromJson} from "../../../src/internal/fromJson"; +import { fromJson } from "../../../src/internal/fromJson"; -describe('roundCorners.fromJson', () => { - it('should generate a url with round corners from array of models', function () { - const transformation = fromJson({actions: - [ +describe("roundCorners.fromJson", () => { + it("should generate a url with round corners from array of models", function () { + const transformation = fromJson({ + actions: [ { - actionType: 'roundCorners', - radius: [10] + actionType: "roundCorners", + radius: [10], }, { - actionType: 'roundCorners', - radius: [10, 20, 30, 40] + actionType: "roundCorners", + radius: [10, 20, 30, 40], }, { - actionType: 'roundCorners', - radius: 'max' - } - ]} - ); - expect(transformation.toString()).toStrictEqual( - 'r_10/r_10:20:30:40/r_max' - ); + actionType: "roundCorners", + radius: "max", + }, + ], + }); + expect(transformation.toString()).toStrictEqual("r_10/r_10:20:30:40/r_max"); }); }); - diff --git a/__TESTS__/unit/fromJson/transcode.fromJson.test.ts b/__TESTS__/unit/fromJson/transcode.fromJson.test.ts index c6263b7..85d4f6f 100644 --- a/__TESTS__/unit/fromJson/transcode.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/transcode.fromJson.test.ts @@ -1,35 +1,51 @@ -import {fromJson} from "../../../src/internal/fromJson"; +import { fromJson } from "../../../src/internal/fromJson"; -describe('transcode.fromJson', () => { - it('should generate a url with transcode actions from array of models', function () { - const transformation = fromJson({actions:[ - { actionType: 'keyframeInterval', interval: 20}, - { actionType: 'fps', fps: 6 }, - { actionType: 'fps', fps: {from: 6, to: 8} }, - { actionType: 'fps', fps: {from: 6} }, - {actionType: 'bitRate', bitRate: 6}, - {actionType: 'bitRate', bitRate: '500k', constant: true}, - {actionType: 'audioCodec', audioCodec: 'aac'}, - {actionType: 'audioFrequency', audioFrequencyType: 'freq8000'}, - {actionType: 'streamingProfile', profile: 'fullHd'}, - {actionType: 'toAnimated', animatedFormat: 'gif', delay: 20, sampling: '4s'}, - {actionType: 'videoCodec', videoCodec: {videoCodecName: 'auto'}}, - {actionType: 'videoCodec', videoCodec: {videoCodecName: 'h264', profile: 'baseline', level: 3.1}} - ]}); +describe("transcode.fromJson", () => { + it("should generate a url with transcode actions from array of models", function () { + const transformation = fromJson({ + actions: [ + { actionType: "keyframeInterval", interval: 20 }, + { actionType: "fps", fps: 6 }, + { actionType: "fps", fps: { from: 6, to: 8 } }, + { actionType: "fps", fps: { from: 6 } }, + { actionType: "bitRate", bitRate: 6 }, + { actionType: "bitRate", bitRate: "500k", constant: true }, + { actionType: "audioCodec", audioCodec: "aac" }, + { actionType: "audioFrequency", audioFrequencyType: "freq8000" }, + { actionType: "streamingProfile", profile: "fullHd" }, + { + actionType: "toAnimated", + animatedFormat: "gif", + delay: 20, + sampling: "4s", + }, + { actionType: "videoCodec", videoCodec: { videoCodecName: "auto" } }, + { + actionType: "videoCodec", + videoCodec: { + videoCodecName: "h264", + profile: "baseline", + level: 3.1, + }, + }, + ], + }); - expect(transformation.toString()).toStrictEqual([ - 'ki_20.0', - 'fps_6', - 'fps_6-8', - 'fps_6-', - 'br_6', - 'br_500k:constant', - 'ac_aac', - 'af_8000', - 'sp_full_hd', - 'dl_20,f_gif,fl_animated,vs_4s', - 'vc_auto', - 'vc_h264:baseline:3.1' - ].join('/')); + expect(transformation.toString()).toStrictEqual( + [ + "ki_20.0", + "fps_6", + "fps_6-8", + "fps_6-", + "br_6", + "br_500k:constant", + "ac_aac", + "af_8000", + "sp_full_hd", + "dl_20,f_gif,fl_animated,vs_4s", + "vc_auto", + "vc_h264:baseline:3.1", + ].join("/") + ); }); }); diff --git a/__TESTS__/unit/fromJson/videoEditTrim.fromJson.test.ts b/__TESTS__/unit/fromJson/videoEditTrim.fromJson.test.ts index 94a4885..6408f11 100644 --- a/__TESTS__/unit/fromJson/videoEditTrim.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/videoEditTrim.fromJson.test.ts @@ -1,38 +1,38 @@ -import {fromJson} from "../../../src/internal/fromJson"; -import {ITrimActionModel} from "../../../src/internal/models/ITrimActionModel"; +import { fromJson } from "../../../src/internal/fromJson"; +import { ITrimActionModel } from "../../../src/internal/models/ITrimActionModel"; -describe('videoEdit.trim fromJson', () => { - it('Should generate TrimAction from model', () => { +describe("videoEdit.trim fromJson", () => { + it("Should generate TrimAction from model", () => { const trimModel: ITrimActionModel = { - actionType: 'trimVideo', - duration: '30%', + actionType: "trimVideo", + duration: "30%", }; - const transformation = fromJson({actions: [trimModel]}); + const transformation = fromJson({ actions: [trimModel] }); - expect(transformation.toString()).toStrictEqual('du_30p'); + expect(transformation.toString()).toStrictEqual("du_30p"); }); - it('Should generate ConcatenateAction with transition from model', () => { + it("Should generate ConcatenateAction with transition from model", () => { const trimModel: ITrimActionModel = { - actionType: 'trimVideo', + actionType: "trimVideo", startOffset: 3, endOffset: 5, }; - const transformation = fromJson({actions: [trimModel]}); - expect(transformation.toString()).toStrictEqual('eo_5,so_3'); + const transformation = fromJson({ actions: [trimModel] }); + expect(transformation.toString()).toStrictEqual("eo_5,so_3"); }); - it('Should generate ConcatenateAction with ImageSource and transition from model', () => { + it("Should generate ConcatenateAction with ImageSource and transition from model", () => { const trimModel: ITrimActionModel = { - actionType: 'trimVideo', + actionType: "trimVideo", startOffset: 3, duration: 5, }; - const transformation = fromJson({actions: [trimModel]}); + const transformation = fromJson({ actions: [trimModel] }); - expect(transformation.toString()).toStrictEqual('du_5,so_3'); + expect(transformation.toString()).toStrictEqual("du_5,so_3"); }); }); diff --git a/__TESTS__/unit/fromJson/volume.fromJson.test.ts b/__TESTS__/unit/fromJson/volume.fromJson.test.ts index 135ee38..a7626b2 100644 --- a/__TESTS__/unit/fromJson/volume.fromJson.test.ts +++ b/__TESTS__/unit/fromJson/volume.fromJson.test.ts @@ -1,45 +1,45 @@ -import {fromJson} from "../../../src/internal/fromJson"; -import {IVolumeActionModel} from "../../../src/internal/models/IVolumeActionModel"; +import { fromJson } from "../../../src/internal/fromJson"; +import { IVolumeActionModel } from "../../../src/internal/models/IVolumeActionModel"; -describe('videoEdit.volume fromJson', () => { - it('Should generate VolumeAction with percentage from model', () => { +describe("videoEdit.volume fromJson", () => { + it("Should generate VolumeAction with percentage from model", () => { const trimModel: IVolumeActionModel = { - actionType: 'volume', + actionType: "volume", volumeValue: { mode: "percent", - value: 10 - } + value: 10, + }, }; - const transformation = fromJson({actions: [trimModel]}); + const transformation = fromJson({ actions: [trimModel] }); - expect(transformation.toString()).toStrictEqual('e_volume:10'); + expect(transformation.toString()).toStrictEqual("e_volume:10"); }); - it('Should generate VolumeAction with decibels from model', () => { + it("Should generate VolumeAction with decibels from model", () => { const trimModel: IVolumeActionModel = { - actionType: 'volume', + actionType: "volume", volumeValue: { mode: "decibels", - value: 10 - } + value: 10, + }, }; - const transformation = fromJson({actions: [trimModel]}); + const transformation = fromJson({ actions: [trimModel] }); - expect(transformation.toString()).toStrictEqual('e_volume:10db'); + expect(transformation.toString()).toStrictEqual("e_volume:10db"); }); - it('Should generate VolumeAction with mute from model', () => { + it("Should generate VolumeAction with mute from model", () => { const trimModel: IVolumeActionModel = { - actionType: 'volume', + actionType: "volume", volumeValue: { mode: "mute", - } + }, }; - const transformation = fromJson({actions: [trimModel]}); + const transformation = fromJson({ actions: [trimModel] }); - expect(transformation.toString()).toStrictEqual('e_volume:mute'); + expect(transformation.toString()).toStrictEqual("e_volume:mute"); }); }); diff --git a/__TESTS__/unit/index.test.ts b/__TESTS__/unit/index.test.ts index 9600c21..553b43c 100644 --- a/__TESTS__/unit/index.test.ts +++ b/__TESTS__/unit/index.test.ts @@ -1,11 +1,7 @@ -import { - Transformation, - Qualifiers, - Actions, -} from '../../src/index'; +import { Transformation, Qualifiers, Actions } from "../../src/index"; -describe('Ensures index exports correctly', () => { - it('Exports correctly', () => { +describe("Ensures index exports correctly", () => { + it("Exports correctly", () => { expect(Transformation).toBeDefined(); expect(Qualifiers).toBeDefined(); expect(Actions).toBeDefined(); diff --git a/__TESTS__/unit/scripts/createEntryPoints.test.ts b/__TESTS__/unit/scripts/createEntryPoints.test.ts index 0ffc158..78ec061 100644 --- a/__TESTS__/unit/scripts/createEntryPoints.test.ts +++ b/__TESTS__/unit/scripts/createEntryPoints.test.ts @@ -2,38 +2,37 @@ import TEST_FILE_STRUCTURE from "../../TestUtils/createEntryMockedFS"; -const createEntryPoints = require('../../../scripts/lib/entryPointsLib'); -const mock = require('mock-fs'); -const fs = require('fs'); +const createEntryPoints = require("../../../scripts/lib/entryPointsLib"); +const mock = require("mock-fs"); +const fs = require("fs"); - -describe('Tests for createEntryPoints', () => { +describe("Tests for createEntryPoints", () => { beforeEach(() => { mock.restore(); mock(TEST_FILE_STRUCTURE); }); - it ('Creates the main entrypoint to the project', () => { + it("Creates the main entrypoint to the project", () => { createEntryPoints.copyPackageJson(); - const mainPackageJson = JSON.parse(fs.readFileSync('./dist/package.json', 'utf-8')); + const mainPackageJson = JSON.parse(fs.readFileSync("./dist/package.json", "utf-8")); // Expect the right main entrypoint - expect(mainPackageJson.main).toBe('./bundles/umd/base.js'); - expect(mainPackageJson.module).toBe('./index.js'); - expect(mainPackageJson.browser).toBe('./index.js'); + expect(mainPackageJson.main).toBe("./bundles/umd/base.js"); + expect(mainPackageJson.module).toBe("./index.js"); + expect(mainPackageJson.browser).toBe("./index.js"); // Expect not to delete existing values - expect(mainPackageJson.fieldA).toBe('foobar'); + expect(mainPackageJson.fieldA).toBe("foobar"); expect(mainPackageJson.sideEffects).toBe(false); }); - it ('Creates a UMD Bundle Entrypoint', () => { + it("Creates a UMD Bundle Entrypoint", () => { createEntryPoints.createUMDBundleEntryPoint(); - const umdBundlePackageJson = JSON.parse(fs.readFileSync('./dist/bundles/umd/package.json', 'utf-8')); + const umdBundlePackageJson = JSON.parse(fs.readFileSync("./dist/bundles/umd/package.json", "utf-8")); // Expect the right main entrypoint - expect(umdBundlePackageJson.main).toBe('./base.js'); + expect(umdBundlePackageJson.main).toBe("./base.js"); // Expect not to delete existing values - expect(umdBundlePackageJson.types).toBe('../../index.d.ts'); + expect(umdBundlePackageJson.types).toBe("../../index.d.ts"); expect(umdBundlePackageJson.sideEffects).toBe(false); }); @@ -41,7 +40,3 @@ describe('Tests for createEntryPoints', () => { mock.restore(); }); }); - - - - diff --git a/__TESTS__/unit/scripts/validatePackageFiles.test.ts b/__TESTS__/unit/scripts/validatePackageFiles.test.ts index 01ce45b..d73b84b 100644 --- a/__TESTS__/unit/scripts/validatePackageFiles.test.ts +++ b/__TESTS__/unit/scripts/validatePackageFiles.test.ts @@ -1,76 +1,82 @@ /* eslint @typescript-eslint/no-var-requires: 0 */ -const validatePackageFiles = require('../../../scripts/validatePackageFiles'); -const MissingRequiredFile = require('../../../scripts/errors/MissingRequiredFile'); -const FoundNonRequiredFile= require('../../../scripts/errors/FoundNonRequiredFile'); +const validatePackageFiles = require("../../../scripts/validatePackageFiles"); +const MissingRequiredFile = require("../../../scripts/errors/MissingRequiredFile"); +const FoundNonRequiredFile = require("../../../scripts/errors/FoundNonRequiredFile"); global.console = console; -const mock = require('mock-fs'); +const mock = require("mock-fs"); - -describe('Tests for ValidatePackageFiles', () => { +describe("Tests for ValidatePackageFiles", () => { beforeEach(() => { mock.restore(); mock({ - 'dist': { - foo: '//AnyFileContents', + dist: { + foo: "//AnyFileContents", bar: { - foobar: '//AnyFileContents' - } - } + foobar: "//AnyFileContents", + }, + }, }); }); - it('Validates an input JSON with a mocked file system', () => { + it("Validates an input JSON with a mocked file system", () => { validatePackageFiles({ - foo: 'file', + foo: "file", bar: { - foobar: 'file' - } + foobar: "file", + }, }); }); - it('Will throw if a file needs to exist, but does not exist', () => { + it("Will throw if a file needs to exist, but does not exist", () => { expect(() => { - validatePackageFiles({ - missingFoo: 'file', - foo: 'file', - bar: { - foobar: 'file' - } - }, './dist'); - }).toThrow(new MissingRequiredFile('dist/missingFoo')); + validatePackageFiles( + { + missingFoo: "file", + foo: "file", + bar: { + foobar: "file", + }, + }, + "./dist" + ); + }).toThrow(new MissingRequiredFile("dist/missingFoo")); }); - - it('Will throw if the file system has more entries than the JSON', () => { + it("Will throw if the file system has more entries than the JSON", () => { expect(() => { - validatePackageFiles({ - foo: 'file', - bar: {} - }, './dist'); - }).toThrow(new FoundNonRequiredFile('dist/bar/foobar')); + validatePackageFiles( + { + foo: "file", + bar: {}, + }, + "./dist" + ); + }).toThrow(new FoundNonRequiredFile("dist/bar/foobar")); }); - it('Will not throw when a key is explicitly set to ignore ', () => { - validatePackageFiles({ - foo: 'file', - bar: false - }, './dist'); + it("Will not throw when a key is explicitly set to ignore ", () => { + validatePackageFiles( + { + foo: "file", + bar: false, + }, + "./dist" + ); }); - it('Will not throw when a a flag is passed and there are missing files in tree', () => { - validatePackageFiles({ - $suppressNonRequiredFilesError: true, - foo: 'file' - }, './dist'); + it("Will not throw when a a flag is passed and there are missing files in tree", () => { + validatePackageFiles( + { + $suppressNonRequiredFilesError: true, + foo: "file", + }, + "./dist" + ); }); afterAll(() => { mock.restore(); }); }); - - - - diff --git a/__TESTS__/unit/toJson/adjust.toJson.test.ts b/__TESTS__/unit/toJson/adjust.toJson.test.ts index c8b51af..5e5b3b6 100644 --- a/__TESTS__/unit/toJson/adjust.toJson.test.ts +++ b/__TESTS__/unit/toJson/adjust.toJson.test.ts @@ -1,82 +1,89 @@ -import {Transformation} from "../../../src"; -import {Adjust} from "../../../src/actions/adjust"; +import { Transformation } from "../../../src"; +import { Adjust } from "../../../src/actions/adjust"; -describe('Adjust toJson()', () => { - it('adjust.improve', () => { - const transformation = new Transformation() - .addAction(Adjust.improve().mode('outdoor').blend(50)); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'improve', - mode: 'outdoor', - blend: 50 - } - ]}); +describe("Adjust toJson()", () => { + it("adjust.improve", () => { + const transformation = new Transformation().addAction(Adjust.improve().mode("outdoor").blend(50)); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "improve", + mode: "outdoor", + blend: 50, + }, + ], + }); }); - it('adjust.unsharpMask', () => { - const transformation = new Transformation() - .addAction(Adjust.unsharpMask().strength(10)); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'unsharpMask', - strength: 10 - } - ]}); + it("adjust.unsharpMask", () => { + const transformation = new Transformation().addAction(Adjust.unsharpMask().strength(10)); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "unsharpMask", + strength: 10, + }, + ], + }); }); - it('adjust.saturation', () => { - const transformation = new Transformation() - .addAction(Adjust.saturation().level(50)); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'saturation', - level: 50 - } - ]}); + it("adjust.saturation", () => { + const transformation = new Transformation().addAction(Adjust.saturation().level(50)); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "saturation", + level: 50, + }, + ], + }); }); - it('adjust.contrast', () => { - const transformation = new Transformation() - .addAction(Adjust.contrast().level(50)); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'contrast', - level: 50 - } - ]}); + it("adjust.contrast", () => { + const transformation = new Transformation().addAction(Adjust.contrast().level(50)); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "contrast", + level: 50, + }, + ], + }); }); - it('adjust.brightness', () => { - const transformation = new Transformation() - .addAction(Adjust.brightness().level(40)); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'brightness', - level: 40 - } - ]}); + it("adjust.brightness", () => { + const transformation = new Transformation().addAction(Adjust.brightness().level(40)); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "brightness", + level: 40, + }, + ], + }); }); - it('adjust.gamma', () => { - const transformation = new Transformation() - .addAction(Adjust.gamma().level(40)); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'gamma', - level: 40 - } - ]}); + it("adjust.gamma", () => { + const transformation = new Transformation().addAction(Adjust.gamma().level(40)); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "gamma", + level: 40, + }, + ], + }); }); - it('adjust.opacity', () => { - const transformation = new Transformation() - .addAction(Adjust.opacity(45)); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'opacity', - level: 45 - } - ]}); + it("adjust.opacity", () => { + const transformation = new Transformation().addAction(Adjust.opacity(45)); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "opacity", + level: 45, + }, + ], + }); }); }); diff --git a/__TESTS__/unit/toJson/backgroundRemoval.toJson.test.ts b/__TESTS__/unit/toJson/backgroundRemoval.toJson.test.ts index 0f9a0f1..e008242 100644 --- a/__TESTS__/unit/toJson/backgroundRemoval.toJson.test.ts +++ b/__TESTS__/unit/toJson/backgroundRemoval.toJson.test.ts @@ -1,67 +1,66 @@ -import {Transformation} from "../../../src"; -import {ForegroundObject, cat, bus, diningTable} from "../../../src/qualifiers/foregroundObject"; -import {Effect} from "../../../src/actions/effect"; +import { Transformation } from "../../../src"; +import { ForegroundObject, cat, bus, diningTable } from "../../../src/qualifiers/foregroundObject"; +import { Effect } from "../../../src/actions/effect"; -describe('BackgroundRemoval toJson()', () => { - it('with fineEdges and hints', () => { - const transformation = new Transformation() - .addAction(Effect.backgroundRemoval().fineEdges(true).hints([ForegroundObject.CAT, ForegroundObject.DOG])); +describe("BackgroundRemoval toJson()", () => { + it("with fineEdges and hints", () => { + const transformation = new Transformation().addAction( + Effect.backgroundRemoval().fineEdges(true).hints([ForegroundObject.CAT, ForegroundObject.DOG]) + ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'backgroundRemoval', + actionType: "backgroundRemoval", fineEdges: true, - hints: [ForegroundObject.CAT, ForegroundObject.DOG] - } - ] + hints: [ForegroundObject.CAT, ForegroundObject.DOG], + }, + ], }); }); - it('with functional hints as spread arg', () => { - const transformation = new Transformation() - .addAction(Effect.backgroundRemoval().fineEdges(true).hints(cat(), bus(), diningTable())); + it("with functional hints as spread arg", () => { + const transformation = new Transformation().addAction( + Effect.backgroundRemoval().fineEdges(true).hints(cat(), bus(), diningTable()) + ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'backgroundRemoval', + actionType: "backgroundRemoval", fineEdges: true, - hints: [ForegroundObject.CAT, ForegroundObject.BUS, ForegroundObject.DINING_TABLE] - } - ] + hints: [ForegroundObject.CAT, ForegroundObject.BUS, ForegroundObject.DINING_TABLE], + }, + ], }); }); - it('with default fineEdges', () => { - const transformation = new Transformation() - .addAction(Effect.backgroundRemoval().fineEdges()); + it("with default fineEdges", () => { + const transformation = new Transformation().addAction(Effect.backgroundRemoval().fineEdges()); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'backgroundRemoval', + actionType: "backgroundRemoval", fineEdges: true, - } - ] + }, + ], }); }); - it('with false fineEdges', () => { - const transformation = new Transformation() - .addAction(Effect.backgroundRemoval().fineEdges(false)); + it("with false fineEdges", () => { + const transformation = new Transformation().addAction(Effect.backgroundRemoval().fineEdges(false)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'backgroundRemoval', + actionType: "backgroundRemoval", fineEdges: false, - } - ] + }, + ], }); }); - it('without fineEdges', () => { - const transformation = new Transformation() - .addAction(Effect.backgroundRemoval()); + it("without fineEdges", () => { + const transformation = new Transformation().addAction(Effect.backgroundRemoval()); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'backgroundRemoval', - } - ] + actionType: "backgroundRemoval", + }, + ], }); }); }); diff --git a/__TESTS__/unit/toJson/border.toJson.test.ts b/__TESTS__/unit/toJson/border.toJson.test.ts index e44c6fb..c24f4b6 100644 --- a/__TESTS__/unit/toJson/border.toJson.test.ts +++ b/__TESTS__/unit/toJson/border.toJson.test.ts @@ -1,48 +1,48 @@ -import {Transformation} from "../../../src"; -import {RoundCorners} from "../../../src/actions"; -import {Border} from "../../../src/actions"; +import { Transformation } from "../../../src"; +import { RoundCorners } from "../../../src/actions"; +import { Border } from "../../../src/actions"; -describe('Border toJson()', () => { - it('border', () => { +describe("Border toJson()", () => { + it("border", () => { const transformation = new Transformation() - .addAction(Border.solid(5, 'black')) + .addAction(Border.solid(5, "black")) .addAction(Border.roundCorners(RoundCorners.max())) .addAction(Border.roundCorners(RoundCorners.byRadius(10, 20, 30))) - .addAction(Border.solid(5, 'black').roundCorners(RoundCorners.max())) - .addAction(Border.roundCorners(RoundCorners.max()).solid(5, 'black')); + .addAction(Border.solid(5, "black").roundCorners(RoundCorners.max())) + .addAction(Border.roundCorners(RoundCorners.max()).solid(5, "black")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'border', + actionType: "border", width: 5, - color: 'black', + color: "black", }, { - actionType: 'border', + actionType: "border", width: 0, - color: 'transparent', - radius: 'max' + color: "transparent", + radius: "max", }, { - actionType: 'border', + actionType: "border", width: 0, - color: 'transparent', - radius: [10, 20, 30] + color: "transparent", + radius: [10, 20, 30], }, { - actionType: 'border', + actionType: "border", width: 5, - color: 'black', - radius: 'max' + color: "black", + radius: "max", }, { - actionType: 'border', + actionType: "border", width: 5, - color: 'black', - radius: 'max' + color: "black", + radius: "max", }, - ] + ], }); }); }); diff --git a/__TESTS__/unit/toJson/concatenate.toJson.test.ts b/__TESTS__/unit/toJson/concatenate.toJson.test.ts index 5966e18..8923748 100644 --- a/__TESTS__/unit/toJson/concatenate.toJson.test.ts +++ b/__TESTS__/unit/toJson/concatenate.toJson.test.ts @@ -1,55 +1,58 @@ -import {Transformation} from '../../../src'; -import {Concatenate} from "../../../src/qualifiers/concatenate"; -import {VideoEdit} from "../../../src/actions"; -import {Format} from "../../../src/qualifiers"; +import { Transformation } from "../../../src"; +import { Concatenate } from "../../../src/qualifiers/concatenate"; +import { VideoEdit } from "../../../src/actions"; +import { Format } from "../../../src/qualifiers"; -describe('concatenate.toJson()', () => { - it('Concatenate video source + prepend + duration + transition', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.concatenate(Concatenate.videoSource('dog')) +describe("concatenate.toJson()", () => { + it("Concatenate video source + prepend + duration + transition", () => { + const transformation = new Transformation().videoEdit( + VideoEdit.concatenate(Concatenate.videoSource("dog")) .prepend() .duration(1) - .transition(Concatenate.videoSource('cat')) - ); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'concatenate', - source: { - sourceType: 'video', - publicId: 'dog' + .transition(Concatenate.videoSource("cat")) + ); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "concatenate", + source: { + sourceType: "video", + publicId: "dog", + }, + prepend: true, + duration: 1, + transition: { + sourceType: "video", + publicId: "cat", + }, }, - prepend: true, - duration: 1, - transition: { - - sourceType: 'video', - publicId: 'cat' - } - } - ]}); + ], + }); }); - it('Concatenate image source + prepend + duration + transition', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.concatenate(Concatenate.imageSource('dog').format(Format.jpg())) + it("Concatenate image source + prepend + duration + transition", () => { + const transformation = new Transformation().videoEdit( + VideoEdit.concatenate(Concatenate.imageSource("dog").format(Format.jpg())) .prepend() .duration(1) - .transition(Concatenate.videoSource('cat')) - ); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'concatenate', - source: { - sourceType: 'image', - publicId: 'dog.jpg' + .transition(Concatenate.videoSource("cat")) + ); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "concatenate", + source: { + sourceType: "image", + publicId: "dog.jpg", + }, + prepend: true, + duration: 1, + transition: { + sourceType: "video", + publicId: "cat", + }, }, - prepend: true, - duration: 1, - transition: { - sourceType: 'video', - publicId: 'cat' - } - } - ]}); + ], + }); }); }); diff --git a/__TESTS__/unit/toJson/conditional.toJson.test.ts b/__TESTS__/unit/toJson/conditional.toJson.test.ts index ebcabdc..ee78459 100644 --- a/__TESTS__/unit/toJson/conditional.toJson.test.ts +++ b/__TESTS__/unit/toJson/conditional.toJson.test.ts @@ -1,40 +1,42 @@ -import {Conditional} from "../../../src/actions/conditional"; -import {Transformation} from "../../../src"; -import {Resize} from "../../../src/actions/resize"; +import { Conditional } from "../../../src/actions/conditional"; +import { Transformation } from "../../../src"; +import { Resize } from "../../../src/actions/resize"; - -describe('Conditional.toJson', ()=>{ - it('Conditional with transformation', () => { +describe("Conditional.toJson", () => { + it("Conditional with transformation", () => { const conditionalTx = new Transformation().addAction( - Conditional.ifCondition('ar >= 1.0', new Transformation().addAction('w_100'))); - const transformation = new Transformation().addAction('w_100'); + Conditional.ifCondition("ar >= 1.0", new Transformation().addAction("w_100")) + ); + const transformation = new Transformation().addAction("w_100"); expect(conditionalTx.toJson()).toStrictEqual({ actions: [ { - actionType: 'ifCondition', - expression: 'ar >= 1.0', - transformation: transformation - } - ] + actionType: "ifCondition", + expression: "ar >= 1.0", + transformation: transformation, + }, + ], }); }); - it('Conditional with if/else combination', () => { + it("Conditional with if/else combination", () => { const conditionalTx = new Transformation().addAction( - Conditional.ifCondition('ar >= 1.0', new Transformation().resize(Resize.scale(50))) - .otherwise(new Transformation().resize(Resize.scale(200)))); + Conditional.ifCondition("ar >= 1.0", new Transformation().resize(Resize.scale(50))).otherwise( + new Transformation().resize(Resize.scale(200)) + ) + ); const transformation = new Transformation().resize(Resize.scale(50)); const otherwise = new Transformation().resize(Resize.scale(200)); expect(conditionalTx.toJson()).toStrictEqual({ actions: [ { - actionType: 'ifCondition', - expression: 'ar >= 1.0', + actionType: "ifCondition", + expression: "ar >= 1.0", transformation: transformation, - otherwise: otherwise - } - ] + otherwise: otherwise, + }, + ], }); }); -}); \ No newline at end of file +}); diff --git a/__TESTS__/unit/toJson/delivery.toJson.test.ts b/__TESTS__/unit/toJson/delivery.toJson.test.ts index f2191e1..ded284c 100644 --- a/__TESTS__/unit/toJson/delivery.toJson.test.ts +++ b/__TESTS__/unit/toJson/delivery.toJson.test.ts @@ -1,166 +1,159 @@ -import {Transformation} from '../../../src'; -import {Delivery} from "../../../src/actions"; -import {ChromaSubSampling, ColorSpace, Format, Quality} from "../../../src/qualifiers"; -import {Progressive} from "../../../src/qualifiers/progressive"; +import { Transformation } from "../../../src"; +import { Delivery } from "../../../src/actions"; +import { ChromaSubSampling, ColorSpace, Format, Quality } from "../../../src/qualifiers"; +import { Progressive } from "../../../src/qualifiers/progressive"; -describe('Delivery.toJson()', () => { - it('delivery.colorSpace', () => { - const transformation = new Transformation() - .addAction(Delivery.colorSpace(ColorSpace.trueColor())); +describe("Delivery.toJson()", () => { + it("delivery.colorSpace", () => { + const transformation = new Transformation().addAction(Delivery.colorSpace(ColorSpace.trueColor())); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'colorSpace', - mode: 'srgbTrueColor' - } - ] - } - ); + actionType: "colorSpace", + mode: "srgbTrueColor", + }, + ], + }); }); - it('delivery.dpr auto', () => { - const transformation = new Transformation() - .addAction(Delivery.dpr('auto')); + it("delivery.dpr auto", () => { + const transformation = new Transformation().addAction(Delivery.dpr("auto")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'dpr', - dpr: 'auto' - } - ] + actionType: "dpr", + dpr: "auto", + }, + ], }); }); - it('delivery.dpr number', () => { - const transformation = new Transformation() - .addAction(Delivery.dpr(2)); + it("delivery.dpr number", () => { + const transformation = new Transformation().addAction(Delivery.dpr(2)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'dpr', - dpr: '2.0' - } - ] + actionType: "dpr", + dpr: "2.0", + }, + ], }); }); - it('delivery.colorSpaceFromICC', () => { - const transformation = new Transformation() - .addAction(Delivery.colorSpaceFromICC('sample')); + it("delivery.colorSpaceFromICC", () => { + const transformation = new Transformation().addAction(Delivery.colorSpaceFromICC("sample")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'colorSpaceFromICC', - publicId: 'sample' - } - ] + actionType: "colorSpaceFromICC", + publicId: "sample", + }, + ], }); }); - it('delivery.density', () => { - const transformation = new Transformation() - .addAction(Delivery.density(1)); + it("delivery.density", () => { + const transformation = new Transformation().addAction(Delivery.density(1)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'density', - density: 1 - } - ] + actionType: "density", + density: 1, + }, + ], }); }); - it('jpg.progressive.semi()', () => { - const transformation = new Transformation() - .addAction(Delivery.format(Format.jpg()).progressive(Progressive.semi())); + it("jpg.progressive.semi()", () => { + const transformation = new Transformation().addAction( + Delivery.format(Format.jpg()).progressive(Progressive.semi()) + ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - progressive: {mode: 'semi'}, - actionType: 'format', - formatType: 'jpg' - } - ] + progressive: { mode: "semi" }, + actionType: "format", + formatType: "jpg", + }, + ], }); }); it('jpg.progressive("semi")', () => { - const transformation = new Transformation() - .addAction(Delivery.format(Format.jpg()).progressive('semi')); + const transformation = new Transformation().addAction(Delivery.format(Format.jpg()).progressive("semi")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - progressive: {mode: 'semi'}, - actionType: 'format', - formatType: 'jpg' - } - ] + progressive: { mode: "semi" }, + actionType: "format", + formatType: "jpg", + }, + ], }); }); - it('gif.lossy()', () => { - const transformation = new Transformation() - .addAction(Delivery.format(Format.gif()).lossy()); + it("gif.lossy()", () => { + const transformation = new Transformation().addAction(Delivery.format(Format.gif()).lossy()); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'format', - formatType: 'gif', - lossy: true - } - ] + actionType: "format", + formatType: "gif", + lossy: true, + }, + ], }); }); - it('quality:80', () => { - const transformation = new Transformation() - .addAction(Delivery.quality('80')); - expect(transformation.toJson()).toStrictEqual({actions:[ - { - actionType: 'quality', - level: '80' - } - ]}); + it("quality:80", () => { + const transformation = new Transformation().addAction(Delivery.quality("80")); + expect(transformation.toJson()).toStrictEqual({ + actions: [ + { + actionType: "quality", + level: "80", + }, + ], + }); }); - it('quality:80.quantization', () => { - const transformation = new Transformation() - .addAction(Delivery.quality('80').quantization(10)); + it("quality:80.quantization", () => { + const transformation = new Transformation().addAction(Delivery.quality("80").quantization(10)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'quality', - level: '80', - quantization: 10 - } - ] + actionType: "quality", + level: "80", + quantization: 10, + }, + ], }); }); - it('quality:auto', () => { - const transformation = new Transformation() - .addAction(Delivery.quality(Quality.auto())); + it("quality:auto", () => { + const transformation = new Transformation().addAction(Delivery.quality(Quality.auto())); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'quality', - level: 'auto' - } - ] + actionType: "quality", + level: "auto", + }, + ], }); }); - it('chromaSubSampling', () => { - const transformation = new Transformation() - .addAction(Delivery.quality('75').chromaSubSampling(ChromaSubSampling.chroma420())); + it("chromaSubSampling", () => { + const transformation = new Transformation().addAction( + Delivery.quality("75").chromaSubSampling(ChromaSubSampling.chroma420()) + ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'quality', - level: '75', - chromaSubSampling: 'CHROMA_420' - } - ] + actionType: "quality", + level: "75", + chromaSubSampling: "CHROMA_420", + }, + ], }); }); }); diff --git a/__TESTS__/unit/toJson/effect.toJson.test.ts b/__TESTS__/unit/toJson/effect.toJson.test.ts index fc2b018..b3353c3 100644 --- a/__TESTS__/unit/toJson/effect.toJson.test.ts +++ b/__TESTS__/unit/toJson/effect.toJson.test.ts @@ -1,390 +1,342 @@ -import {Transformation} from "../../../src"; -import {Effect} from "../../../src/actions/effect"; -import {halftone4x4Orthogonal} from "../../../src/qualifiers/dither"; -import {rodMonochromacy} from "../../../src/qualifiers/simulateColorBlind"; -import {Region} from "../../../src/qualifiers"; +import { Transformation } from "../../../src"; +import { Effect } from "../../../src/actions/effect"; +import { halftone4x4Orthogonal } from "../../../src/qualifiers/dither"; +import { rodMonochromacy } from "../../../src/qualifiers/simulateColorBlind"; +import { Region } from "../../../src/qualifiers"; - -describe('Effect toJson()', () => { - it('effect.sepia', () => { - const transformation = new Transformation() - .addAction(Effect.sepia()); +describe("Effect toJson()", () => { + it("effect.sepia", () => { + const transformation = new Transformation().addAction(Effect.sepia()); expect(transformation.toJson()).toStrictEqual({ - actions: [ - {actionType: 'sepia'} - ] + actions: [{ actionType: "sepia" }], }); }); - it('effect.boomerang', () => { - const transformation = new Transformation() - .addAction(Effect.boomerang()); + it("effect.boomerang", () => { + const transformation = new Transformation().addAction(Effect.boomerang()); expect(transformation.toJson()).toStrictEqual({ - actions: [ - {actionType: 'boomerang'} - ] + actions: [{ actionType: "boomerang" }], }); }); - it('effect.grayscale', () => { - const transformation = new Transformation() - .addAction(Effect.grayscale()); + it("effect.grayscale", () => { + const transformation = new Transformation().addAction(Effect.grayscale()); expect(transformation.toJson()).toStrictEqual({ - actions: [ - {actionType: 'grayscale'} - ] + actions: [{ actionType: "grayscale" }], }); }); - it('effect.advancedRedEye', () => { - const transformation = new Transformation() - .addAction(Effect.advancedRedEye()); + it("effect.advancedRedEye", () => { + const transformation = new Transformation().addAction(Effect.advancedRedEye()); expect(transformation.toJson()).toStrictEqual({ - actions: [ - {actionType: 'advancedRedEye'} - ] + actions: [{ actionType: "advancedRedEye" }], }); }); - it('effect.negate', () => { - const transformation = new Transformation() - .addAction(Effect.negate()); + it("effect.negate", () => { + const transformation = new Transformation().addAction(Effect.negate()); expect(transformation.toJson()).toStrictEqual({ - actions: [ - {actionType: 'negate'} - ] + actions: [{ actionType: "negate" }], }); }); - it('effect.redEye', () => { - const transformation = new Transformation() - .addAction(Effect.redEye()); + it("effect.redEye", () => { + const transformation = new Transformation().addAction(Effect.redEye()); expect(transformation.toJson()).toStrictEqual({ - actions: [ - {actionType: 'redEye'} - ] + actions: [{ actionType: "redEye" }], }); }); - it('effect.reverse', () => { - const transformation = new Transformation() - .addAction(Effect.reverse()); + it("effect.reverse", () => { + const transformation = new Transformation().addAction(Effect.reverse()); expect(transformation.toJson()).toStrictEqual({ - actions: [ - {actionType: 'reverse'} - ] + actions: [{ actionType: "reverse" }], }); }); - it('effect.transition', () => { - const transformation = new Transformation() - .addAction(Effect.transition()); + it("effect.transition", () => { + const transformation = new Transformation().addAction(Effect.transition()); expect(transformation.toJson()).toStrictEqual({ - actions: [ - {actionType: 'transition'} - ] + actions: [{ actionType: "transition" }], }); }); - it('effect.shadow', () => { - const transformation = new Transformation() - .addAction(Effect.shadow(4).offsetX(5).offsetY(8).color('red')); + it("effect.shadow", () => { + const transformation = new Transformation().addAction(Effect.shadow(4).offsetX(5).offsetY(8).color("red")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'shadow', + actionType: "shadow", offsetX: 5, offsetY: 8, - color: 'red' - } - ] + color: "red", + }, + ], }); }); - it('effect.colorize', () => { - const transformation = new Transformation() - .addAction(Effect.colorize(10).color('red')); + it("effect.colorize", () => { + const transformation = new Transformation().addAction(Effect.colorize(10).color("red")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'colorize', + actionType: "colorize", level: 10, - color: 'red' - } - ] + color: "red", + }, + ], }); }); - it('effect.oilPaint', () => { - const transformation = new Transformation() - .addAction(Effect.oilPaint().strength(8)); + it("effect.oilPaint", () => { + const transformation = new Transformation().addAction(Effect.oilPaint().strength(8)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'oilPaint', + actionType: "oilPaint", strength: 8, - } - ] + }, + ], }); }); - it('effect.cartoonify', () => { - const transformation = new Transformation() - .addAction(Effect.cartoonify().lineStrength(70).colorReductionLevel(80)); + it("effect.cartoonify", () => { + const transformation = new Transformation().addAction(Effect.cartoonify().lineStrength(70).colorReductionLevel(80)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'cartoonify', + actionType: "cartoonify", colorReductionLevel: 80, - lineStrength: 70 - } - ] + lineStrength: 70, + }, + ], }); }); - it('effect.outline', () => { - const transformation = new Transformation() - .addAction(Effect.outline().width(100).color("lightblue")); + it("effect.outline", () => { + const transformation = new Transformation().addAction(Effect.outline().width(100).color("lightblue")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'outline', + actionType: "outline", width: 100, - color: 'lightblue' - } - ] + color: "lightblue", + }, + ], }); }); - it('effect.blackwhite', () => { - const transformation = new Transformation() - .addAction(Effect.blackwhite().threshold(40)); + it("effect.blackwhite", () => { + const transformation = new Transformation().addAction(Effect.blackwhite().threshold(40)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'blackwhite', + actionType: "blackwhite", level: 40, - } - ] + }, + ], }); }); - it('effect.accelerate', () => { - const transformation = new Transformation() - .addAction(Effect.accelerate().rate(5)); + it("effect.accelerate", () => { + const transformation = new Transformation().addAction(Effect.accelerate().rate(5)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'accelerate', + actionType: "accelerate", rate: 5, - } - ] + }, + ], }); }); - it('effect.loop', () => { - const transformation = new Transformation() - .addAction(Effect.loop().additionalIterations(5)); + it("effect.loop", () => { + const transformation = new Transformation().addAction(Effect.loop().additionalIterations(5)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'loop', + actionType: "loop", iterations: 5, - } - ] + }, + ], }); }); - it('effect.make_transparent', () => { - const transformation = new Transformation() - .addAction(Effect.makeTransparent().tolerance(5).colorToReplace('red')); + it("effect.make_transparent", () => { + const transformation = new Transformation().addAction(Effect.makeTransparent().tolerance(5).colorToReplace("red")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'makeTransparent', + actionType: "makeTransparent", tolerance: 5, - color: 'red' - } - ] + color: "red", + }, + ], }); }); - it('effect.noise', () => { - const transformation = new Transformation() - .addAction(Effect.noise().level(50)); + it("effect.noise", () => { + const transformation = new Transformation().addAction(Effect.noise().level(50)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'noise', + actionType: "noise", level: 50, - } - ] + }, + ], }); }); - it('effect.vignette', () => { - const transformation = new Transformation() - .addAction(Effect.vignette().strength(5)); + it("effect.vignette", () => { + const transformation = new Transformation().addAction(Effect.vignette().strength(5)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'vignette', + actionType: "vignette", strength: 5, - } - ] + }, + ], }); }); - it('effect.dither', () => { - const transformation = new Transformation() - .addAction(Effect.dither().type(halftone4x4Orthogonal())); + it("effect.dither", () => { + const transformation = new Transformation().addAction(Effect.dither().type(halftone4x4Orthogonal())); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'dither', + actionType: "dither", type: 9, - } - ] + }, + ], }); }); - it('effect.vectorize', () => { - const transformation = new Transformation() - .addAction(Effect.vectorize().numOfColors(17).detailsLevel(100)); + it("effect.vectorize", () => { + const transformation = new Transformation().addAction(Effect.vectorize().numOfColors(17).detailsLevel(100)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'vectorize', + actionType: "vectorize", numOfColors: 17, - detailLevel: 100 - } - ] + detailLevel: 100, + }, + ], }); }); - it('effect.gradientFade', () => { - const transformation = new Transformation() - .addAction(Effect.gradientFade() - .strength(5) - .horizontalStartPoint(10) - .verticalStartPoint(20)); + it("effect.gradientFade", () => { + const transformation = new Transformation().addAction( + Effect.gradientFade().strength(5).horizontalStartPoint(10).verticalStartPoint(20) + ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'gradientFade', + actionType: "gradientFade", strength: 5, horizontalStartPoint: 10, - verticalStartPoint: 20 - } - ] + verticalStartPoint: 20, + }, + ], }); }); - it('effect.assistColorBlind', () => { - const transformation = new Transformation() - .addAction(Effect.assistColorBlind().stripesStrength(20)); + it("effect.assistColorBlind", () => { + const transformation = new Transformation().addAction(Effect.assistColorBlind().stripesStrength(20)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'assistColorblind', - type: 'stripes', - stripesStrength: 20 - } - ] + actionType: "assistColorblind", + type: "stripes", + stripesStrength: 20, + }, + ], }); }); - it('effect.simulateColorBlind', () => { - const transformation = new Transformation() - .addAction(Effect.simulateColorBlind().condition(rodMonochromacy())); + it("effect.simulateColorBlind", () => { + const transformation = new Transformation().addAction(Effect.simulateColorBlind().condition(rodMonochromacy())); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'simulateColorblind', - condition: 'rod_monochromacy' - } - ] + actionType: "simulateColorblind", + condition: "rod_monochromacy", + }, + ], }); }); - it('effect.deshake', () => { - const transformation = new Transformation() - .addAction(Effect.deshake().shakeStrength(16)); + it("effect.deshake", () => { + const transformation = new Transformation().addAction(Effect.deshake().shakeStrength(16)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'deshake', - pixels: 16 - } - ] + actionType: "deshake", + pixels: 16, + }, + ], }); }); - it('effect.pixelate', () => { - const transformation = new Transformation() - .addAction(Effect.pixelate().squareSize(15).region(Region.faces())); + it("effect.pixelate", () => { + const transformation = new Transformation().addAction(Effect.pixelate().squareSize(15).region(Region.faces())); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'pixelate', + actionType: "pixelate", squareSize: 15, - region: {RegionType: 'faces'} - } - ] + region: { RegionType: "faces" }, + }, + ], }); }); - it('effect.blur', () => { - const transformation = new Transformation() - .addAction(Effect.blur().strength(5)); + it("effect.blur", () => { + const transformation = new Transformation().addAction(Effect.blur().strength(5)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'blur', + actionType: "blur", strength: 5, - } - ] + }, + ], }); }); - it('effect.FadeIn', () => { - const transformation = new Transformation() - .addAction(Effect.fadeIn(50)); + it("effect.FadeIn", () => { + const transformation = new Transformation().addAction(Effect.fadeIn(50)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'fadeIn', + actionType: "fadeIn", length: 50, - } - ] + }, + ], }); }); - it('effect.FadeOut', () => { - const transformation = new Transformation() - .addAction(Effect.fadeOut(50)); + it("effect.FadeOut", () => { + const transformation = new Transformation().addAction(Effect.fadeOut(50)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'fadeOut', + actionType: "fadeOut", length: 50, - } - ] + }, + ], }); }); - it('effect.DropShadow', () => { - const transformation = new Transformation() - .addAction(Effect.dropShadow().spread(30).elevation(20).azimuth(60)); + it("effect.DropShadow", () => { + const transformation = new Transformation().addAction(Effect.dropShadow().spread(30).elevation(20).azimuth(60)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'dropshadow', + actionType: "dropshadow", spread: 30, elevation: 20, azimuth: 60, - } - ] + }, + ], }); }); }); diff --git a/__TESTS__/unit/toJson/generativeRemove.toJson.test.ts b/__TESTS__/unit/toJson/generativeRemove.toJson.test.ts index b0ea0c8..60379dc 100644 --- a/__TESTS__/unit/toJson/generativeRemove.toJson.test.ts +++ b/__TESTS__/unit/toJson/generativeRemove.toJson.test.ts @@ -5,10 +5,7 @@ import { GenerativeRemove } from "../../../src/actions/effect/GenerativeRemove"; describe("GenerativeRemove.toJson()", () => { it("produces correct action JSON", () => { const testCases: Array<[GenerativeRemove, unknown]> = [ - [ - Effect.generativeRemove().prompt("dog"), - { actionType: "generativeRemove", prompts: ["dog"] }, - ], + [Effect.generativeRemove().prompt("dog"), { actionType: "generativeRemove", prompts: ["dog"] }], [ Effect.generativeRemove().prompt("dog").detectMultiple(), { @@ -17,10 +14,7 @@ describe("GenerativeRemove.toJson()", () => { detectMultiple: true, }, ], - [ - Effect.generativeRemove().prompts(["dog", "cat"]), - { actionType: "generativeRemove", prompts: ["dog", "cat"] }, - ], + [Effect.generativeRemove().prompts(["dog", "cat"]), { actionType: "generativeRemove", prompts: ["dog", "cat"] }], [ Effect.generativeRemove().region({ x: 100, diff --git a/__TESTS__/unit/toJson/overlayUnderlay.toJson.test.ts b/__TESTS__/unit/toJson/overlayUnderlay.toJson.test.ts index 0c3d073..382eea4 100644 --- a/__TESTS__/unit/toJson/overlayUnderlay.toJson.test.ts +++ b/__TESTS__/unit/toJson/overlayUnderlay.toJson.test.ts @@ -1,8 +1,8 @@ -import {Transformation} from "../../../src"; -import {Overlay} from "../../../src/actions/overlay"; -import {Source} from "../../../src/qualifiers/source"; -import {scale} from "../../../src/actions/resize"; -import {Position} from "../../../src/qualifiers/position"; +import { Transformation } from "../../../src"; +import { Overlay } from "../../../src/actions/overlay"; +import { Source } from "../../../src/qualifiers/source"; +import { scale } from "../../../src/actions/resize"; +import { Position } from "../../../src/qualifiers/position"; import { FontHinting, FontStyle, @@ -10,273 +10,308 @@ import { Gravity, Stroke, TextAlignment, - TextDecoration + TextDecoration, } from "../../../src/qualifiers"; -import {Compass} from "../../../src/qualifiers/compass"; -import {Timeline} from "../../../src/qualifiers/timeline"; -import {BlendMode} from "../../../src/qualifiers/blendMode"; -import {TextStyle} from "../../../src/qualifiers/textStyle"; -import {FontAntialias} from "../../../src/qualifiers/FontAntialias"; -import {Underlay} from "../../../src/actions"; -import {UnsupportedError} from "../../../src/internal/utils/unsupportedError"; +import { Compass } from "../../../src/qualifiers/compass"; +import { Timeline } from "../../../src/qualifiers/timeline"; +import { BlendMode } from "../../../src/qualifiers/blendMode"; +import { TextStyle } from "../../../src/qualifiers/textStyle"; +import { FontAntialias } from "../../../src/qualifiers/FontAntialias"; +import { Underlay } from "../../../src/actions"; +import { UnsupportedError } from "../../../src/internal/utils/unsupportedError"; -describe('Overlay & Underlay toJson', () => { - it('Should generate Overlay model for image source', () => { +describe("Overlay & Underlay toJson", () => { + it("Should generate Overlay model for image source", () => { const transformation = new Transformation(); transformation.addAction( - Overlay.source(Source.image('sample').transformation(new Transformation().resize(scale(100).aspectRatio(7)))) - .position(new Position().offsetX(1).offsetY(2).tiled().allowOverflow().gravity(Gravity.compass(Compass.northEast()))) + Overlay.source(Source.image("sample").transformation(new Transformation().resize(scale(100).aspectRatio(7)))) + .position( + new Position().offsetX(1).offsetY(2).tiled().allowOverflow().gravity(Gravity.compass(Compass.northEast())) + ) .blendMode(BlendMode.multiply()) ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'overlay', + actionType: "overlay", source: { - sourceType: 'image', - publicId: 'sample', + sourceType: "image", + publicId: "sample", transformation: { actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: '7.0'}} - ] - } + { + actionType: "scale", + dimensions: { width: 100, aspectRatio: "7.0" }, + }, + ], + }, }, position: { offsetX: 1, offsetY: 2, tiled: true, allowOverflow: true, - gravity: {gravityType: 'direction', compass: 'north_east'} + gravity: { gravityType: "direction", compass: "north_east" }, }, - blendMode: { blendModeType:'multiply' } - } - ] + blendMode: { blendModeType: "multiply" }, + }, + ], }); }); - it('Should generate Overlay model for video source', () => { + it("Should generate Overlay model for video source", () => { const transformation = new Transformation(); transformation.addAction( - Overlay.source(Source.video('dog.mp4').transformation(new Transformation().resize(scale(100).aspectRatio(7)))) - .position(new Position().offsetX(1).offsetY(2).tiled().allowOverflow().gravity(Gravity.compass(Compass.northEast()))) + Overlay.source(Source.video("dog.mp4").transformation(new Transformation().resize(scale(100).aspectRatio(7)))) + .position( + new Position().offsetX(1).offsetY(2).tiled().allowOverflow().gravity(Gravity.compass(Compass.northEast())) + ) .timeline(Timeline.position().startOffset(1).duration(2)) ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'overlay', + actionType: "overlay", source: { - sourceType: 'video', - publicId: 'dog.mp4', + sourceType: "video", + publicId: "dog.mp4", transformation: { actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: '7.0'}} - ] - } + { + actionType: "scale", + dimensions: { width: 100, aspectRatio: "7.0" }, + }, + ], + }, }, position: { offsetX: 1, offsetY: 2, tiled: true, allowOverflow: true, - gravity: {gravityType: 'direction', compass: 'north_east'} + gravity: { gravityType: "direction", compass: "north_east" }, }, timelinePosition: { - startOffset: '1', - duration: '2' - } - } - ] + startOffset: "1", + duration: "2", + }, + }, + ], }); }); - it('Should generate Overlay model for fetch source', () => { + it("Should generate Overlay model for fetch source", () => { const transformation = new Transformation(); transformation.addAction( - Overlay.source(Source.fetch('https://some/image.jpg').transformation(new Transformation().resize(scale(100).aspectRatio(7)))) - .position(new Position().offsetX(1).offsetY(2).tiled().allowOverflow().gravity(Gravity.compass(Compass.northEast()))) + Overlay.source( + Source.fetch("https://some/image.jpg").transformation(new Transformation().resize(scale(100).aspectRatio(7))) + ) + .position( + new Position().offsetX(1).offsetY(2).tiled().allowOverflow().gravity(Gravity.compass(Compass.northEast())) + ) .blendMode(BlendMode.multiply()) ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'overlay', + actionType: "overlay", source: { - sourceType: 'fetch', - url: 'https://some/image.jpg', + sourceType: "fetch", + url: "https://some/image.jpg", transformation: { actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: '7.0'}} - ] - } + { + actionType: "scale", + dimensions: { width: 100, aspectRatio: "7.0" }, + }, + ], + }, }, position: { offsetX: 1, offsetY: 2, tiled: true, allowOverflow: true, - gravity: {gravityType: 'direction', compass: 'north_east'} + gravity: { gravityType: "direction", compass: "north_east" }, }, - blendMode: {blendModeType: 'multiply'} - } - ] + blendMode: { blendModeType: "multiply" }, + }, + ], }); }); - it('Should generate Underlay model for text source', () => { + it("Should generate Underlay model for text source", () => { const transformation = new Transformation(); transformation.addAction( - Underlay.source(Source.text('example', new TextStyle('arial', 1) - .fontWeight(FontWeight.bold()) - .fontStyle(FontStyle.italic()) - .fontAntialias(FontAntialias.fast()) - .fontHinting(FontHinting.slight()) - .textDecoration(TextDecoration.strikethrough()) - .textAlignment(TextAlignment.center()) - .stroke(Stroke.solid(2, 'white')) - .letterSpacing(2.3) - .lineSpacing(3.2) + Underlay.source( + Source.text( + "example", + new TextStyle("arial", 1) + .fontWeight(FontWeight.bold()) + .fontStyle(FontStyle.italic()) + .fontAntialias(FontAntialias.fast()) + .fontHinting(FontHinting.slight()) + .textDecoration(TextDecoration.strikethrough()) + .textAlignment(TextAlignment.center()) + .stroke(Stroke.solid(2, "white")) + .letterSpacing(2.3) + .lineSpacing(3.2) + ) + .textColor("red") + .backgroundColor("blue") + .transformation(new Transformation().resize(scale(100).aspectRatio(7))) ) - .textColor('red') - .backgroundColor('blue') - .transformation(new Transformation().resize(scale(100).aspectRatio(7)))) ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'underlay', + actionType: "underlay", source: { - sourceType: 'text', - text: 'example', + sourceType: "text", + text: "example", textStyle: { - fontFamily: 'arial', + fontFamily: "arial", fontSize: 1, - fontWeight: 'bold', - fontStyle: 'italic', - fontAntialias: 'fast', - fontHinting: 'slight', - textDecoration: 'strikethrough', - textAlignment: 'center', - stroke: {width: 2, color: 'white'}, + fontWeight: "bold", + fontStyle: "italic", + fontAntialias: "fast", + fontHinting: "slight", + textDecoration: "strikethrough", + textAlignment: "center", + stroke: { width: 2, color: "white" }, letterSpacing: 2.3, - lineSpacing: 3.2 + lineSpacing: 3.2, }, - textColor: 'red', - backgroundColor: 'blue', + textColor: "red", + backgroundColor: "blue", transformation: { actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: '7.0'}} - ] - } - } - } - ] + { + actionType: "scale", + dimensions: { width: 100, aspectRatio: "7.0" }, + }, + ], + }, + }, + }, + ], }); }); - it('Should generate Underlay model for subtitles source', () => { + it("Should generate Underlay model for subtitles source", () => { const transformation = new Transformation(); transformation.addAction( - Underlay.source(Source.subtitles('example').textStyle(new TextStyle('arial', 1) - .fontWeight(FontWeight.bold()) - .fontStyle(FontStyle.italic()) - .fontAntialias(FontAntialias.fast()) - .fontHinting(FontHinting.slight()) - .textDecoration(TextDecoration.strikethrough()) - .textAlignment(TextAlignment.center()) - .stroke(Stroke.solid(2, 'white')) - .letterSpacing(2.3) - .lineSpacing(3.2) + Underlay.source( + Source.subtitles("example") + .textStyle( + new TextStyle("arial", 1) + .fontWeight(FontWeight.bold()) + .fontStyle(FontStyle.italic()) + .fontAntialias(FontAntialias.fast()) + .fontHinting(FontHinting.slight()) + .textDecoration(TextDecoration.strikethrough()) + .textAlignment(TextAlignment.center()) + .stroke(Stroke.solid(2, "white")) + .letterSpacing(2.3) + .lineSpacing(3.2) + ) + .textColor("red") + .backgroundColor("blue") + .transformation(new Transformation().resize(scale(100).aspectRatio(7))) ) - .textColor('red') - .backgroundColor('blue') - .transformation(new Transformation().resize(scale(100).aspectRatio(7)))) ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'underlay', + actionType: "underlay", source: { - sourceType: 'subtitles', - publicId: 'example', + sourceType: "subtitles", + publicId: "example", textStyle: { - fontFamily: 'arial', + fontFamily: "arial", fontSize: 1, - fontWeight: 'bold', - fontStyle: 'italic', - fontAntialias: 'fast', - fontHinting: 'slight', - textDecoration: 'strikethrough', - textAlignment: 'center', - stroke: {width: 2, color: 'white'}, + fontWeight: "bold", + fontStyle: "italic", + fontAntialias: "fast", + fontHinting: "slight", + textDecoration: "strikethrough", + textAlignment: "center", + stroke: { width: 2, color: "white" }, letterSpacing: 2.3, - lineSpacing: 3.2 + lineSpacing: 3.2, }, - textColor: 'red', - backgroundColor: 'blue', + textColor: "red", + backgroundColor: "blue", transformation: { actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: '7.0'}} - ] - } - } - } - ] + { + actionType: "scale", + dimensions: { width: 100, aspectRatio: "7.0" }, + }, + ], + }, + }, + }, + ], }); }); - it('Should generate Overlay model for source with Blendmode.antiRemoval', () => { + it("Should generate Overlay model for source with Blendmode.antiRemoval", () => { const transformation = new Transformation(); transformation.addAction( - Overlay.source(Source.fetch('https://some/image.jpg').transformation(new Transformation().resize(scale(100).aspectRatio(7)))) - .position(new Position().offsetX(1).offsetY(2).tiled().allowOverflow().gravity(Gravity.compass(Compass.northEast()))) + Overlay.source( + Source.fetch("https://some/image.jpg").transformation(new Transformation().resize(scale(100).aspectRatio(7))) + ) + .position( + new Position().offsetX(1).offsetY(2).tiled().allowOverflow().gravity(Gravity.compass(Compass.northEast())) + ) .blendMode(BlendMode.antiRemoval(95)) ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'overlay', + actionType: "overlay", source: { - sourceType: 'fetch', - url: 'https://some/image.jpg', + sourceType: "fetch", + url: "https://some/image.jpg", transformation: { actions: [ - {actionType: 'scale', dimensions: {width: 100, aspectRatio: '7.0'}} - ] - } + { + actionType: "scale", + dimensions: { width: 100, aspectRatio: "7.0" }, + }, + ], + }, }, position: { offsetX: 1, offsetY: 2, tiled: true, allowOverflow: true, - gravity: {gravityType: 'direction', compass: 'north_east'} + gravity: { gravityType: "direction", compass: "north_east" }, }, - blendMode: {blendModeType: 'antiRemoval', level: '95'} - } - ] + blendMode: { blendModeType: "antiRemoval", level: "95" }, + }, + ], }); }); - it('Should return error when there is unsupported transformation inside', () => { + it("Should return error when there is unsupported transformation inside", () => { const transformation = new Transformation(); transformation.addAction( - Overlay.source(Source.image('sample').transformation(new Transformation() - .resize(scale(100).width(800)) - .backgroundColor("red") - )) + Overlay.source( + Source.image("sample").transformation(new Transformation().resize(scale(100).width(800)).backgroundColor("red")) + ) ); - expect(transformation.toJson()).toStrictEqual( - { - error: new UnsupportedError('unsupported action BackgroundColor') - } - ); + expect(transformation.toJson()).toStrictEqual({ + error: new UnsupportedError("unsupported action BackgroundColor"), + }); }); }); diff --git a/__TESTS__/unit/toJson/preview.toJson.test.ts b/__TESTS__/unit/toJson/preview.toJson.test.ts index 816fe7d..5a38a18 100644 --- a/__TESTS__/unit/toJson/preview.toJson.test.ts +++ b/__TESTS__/unit/toJson/preview.toJson.test.ts @@ -1,23 +1,20 @@ -import {Transformation} from '../../../src'; -import {VideoEdit} from "../../../src/actions"; +import { Transformation } from "../../../src"; +import { VideoEdit } from "../../../src/actions"; -describe('videoEdit.preview toJson', () => { - it('Should return a json representation of given preview action', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.preview() - .duration(1) - .maximumSegments(10) - .minimumSegmentDuration(1) - ); +describe("videoEdit.preview toJson", () => { + it("Should return a json representation of given preview action", () => { + const transformation = new Transformation().videoEdit( + VideoEdit.preview().duration(1).maximumSegments(10).minimumSegmentDuration(1) + ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'preview', + actionType: "preview", duration: 1, maximumSegments: 10, - minimumSegmentDuration: 1 - } - ] + minimumSegmentDuration: 1, + }, + ], }); }); }); diff --git a/__TESTS__/unit/toJson/resize.toJson.test.ts b/__TESTS__/unit/toJson/resize.toJson.test.ts index cabb28c..36338e3 100644 --- a/__TESTS__/unit/toJson/resize.toJson.test.ts +++ b/__TESTS__/unit/toJson/resize.toJson.test.ts @@ -1,155 +1,154 @@ -import {Transformation} from '../../../src'; -import {Resize} from "../../../src/actions"; -import {AspectRatio, Background, GradientDirection} from "../../../src/qualifiers"; -import {Gravity} from "../../../src/qualifiers"; -import {face, FocusOn} from "../../../src/qualifiers/focusOn"; -import {AutoFocus} from "../../../src/qualifiers/autoFocus"; -import {autoGravity} from "../../../src/qualifiers/gravity"; - -describe('resize.toJson()', () => { - it('scale', () => { - const transformation = new Transformation() - .addAction(Resize.scale(200)); +import { Transformation } from "../../../src"; +import { Resize } from "../../../src/actions"; +import { AspectRatio, Background, GradientDirection } from "../../../src/qualifiers"; +import { Gravity } from "../../../src/qualifiers"; +import { face, FocusOn } from "../../../src/qualifiers/focusOn"; +import { AutoFocus } from "../../../src/qualifiers/autoFocus"; +import { autoGravity } from "../../../src/qualifiers/gravity"; + +describe("resize.toJson()", () => { + it("scale", () => { + const transformation = new Transformation().addAction(Resize.scale(200)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - "actionType": "scale", - "dimensions": { - "width": 200 - } - } - ] + actionType: "scale", + dimensions: { + width: 200, + }, + }, + ], }); }); - it('scale.fit.limitFit.minimumFit.crop.fill.limitFill.thumbnail.pad.limitPad.minimumPad', () => { + it("scale.fit.limitFit.minimumFit.crop.fill.limitFill.thumbnail.pad.limitPad.minimumPad", () => { const transformation = new Transformation() .addAction(Resize.scale(200).aspectRatio(7)) - .addAction(Resize.fit(100, 200).aspectRatio('16:9')) + .addAction(Resize.fit(100, 200).aspectRatio("16:9")) .addAction(Resize.limitFit(100).aspectRatio(AspectRatio.ar16X9())) .addAction(Resize.minimumFit(100).aspectRatio(AspectRatio.ignoreInitialAspectRatio())) - .addAction(Resize.crop(100).x(3).y(4).gravity('north_east').zoom(10)) - .addAction(Resize.fill(200).x(3).y(4).gravity('south')) - .addAction(Resize.limitFill(200).x(3).y(4).gravity('south')) - .addAction(Resize.thumbnail(100).gravity('south').zoom(4)) - .addAction(Resize.pad(100).gravity('south').offsetX(3).offsetY(4)) - .addAction(Resize.limitPad(100).gravity('south').offsetX(3).offsetY(4)) - .addAction(Resize.minimumPad(100).gravity('south').offsetX(3).offsetY(4)) + .addAction(Resize.crop(100).x(3).y(4).gravity("north_east").zoom(10)) + .addAction(Resize.fill(200).x(3).y(4).gravity("south")) + .addAction(Resize.limitFill(200).x(3).y(4).gravity("south")) + .addAction(Resize.thumbnail(100).gravity("south").zoom(4)) + .addAction(Resize.pad(100).gravity("south").offsetX(3).offsetY(4)) + .addAction(Resize.limitPad(100).gravity("south").offsetX(3).offsetY(4)) + .addAction(Resize.minimumPad(100).gravity("south").offsetX(3).offsetY(4)) .addAction(Resize.fill(100, 200).gravity(Gravity.focusOn(FocusOn.ocr()))); expect(transformation.toJson()).toStrictEqual({ actions: [ { - "actionType": "scale", - "dimensions": { - "aspectRatio": "7.0", - "width": 200 - } + actionType: "scale", + dimensions: { + aspectRatio: "7.0", + width: 200, + }, }, { - "actionType": "fit", - "dimensions": { - "aspectRatio": "16:9", - "height": 200, - "width": 100 - } + actionType: "fit", + dimensions: { + aspectRatio: "16:9", + height: 200, + width: 100, + }, }, { - "actionType": "limitFit", - "dimensions": { - "aspectRatio": "16:9", - "width": 100 - } + actionType: "limitFit", + dimensions: { + aspectRatio: "16:9", + width: 100, + }, }, { - "actionType": "minimumFit", - "dimensions": { - "aspectRatio": "ignore_aspect_ratio", - "width": 100 - } + actionType: "minimumFit", + dimensions: { + aspectRatio: "ignore_aspect_ratio", + width: 100, + }, }, { - "actionType": "crop", - "dimensions": { - "width": 100 + actionType: "crop", + dimensions: { + width: 100, }, x: 3, y: 4, gravity: { compass: "north_east", - gravityType: "direction" + gravityType: "direction", }, - zoom: 10 + zoom: 10, }, { - "actionType": "fill", - "dimensions": { - "width": 200 + actionType: "fill", + dimensions: { + width: 200, }, x: 3, y: 4, gravity: { compass: "south", - gravityType: "direction" - } + gravityType: "direction", + }, }, { - "actionType": "limitFill", - "dimensions": { - "width": 200 + actionType: "limitFill", + dimensions: { + width: 200, }, x: 3, y: 4, gravity: { compass: "south", - gravityType: "direction" - } + gravityType: "direction", + }, }, { - "actionType": "thumbnail", - "dimensions": { - "width": 100 + actionType: "thumbnail", + dimensions: { + width: 100, }, gravity: { compass: "south", - gravityType: "direction" + gravityType: "direction", }, - zoom: 4 + zoom: 4, }, { - "actionType": "pad", - "dimensions": { - "width": 100 + actionType: "pad", + dimensions: { + width: 100, }, gravity: { compass: "south", - gravityType: "direction" + gravityType: "direction", }, x: 3, - y: 4 + y: 4, }, { - "actionType": "limitPad", - "dimensions": { - "width": 100 + actionType: "limitPad", + dimensions: { + width: 100, }, gravity: { compass: "south", - gravityType: "direction" + gravityType: "direction", }, x: 3, - y: 4 + y: 4, }, { - "actionType": "minimumPad", - "dimensions": { - "width": 100 + actionType: "minimumPad", + dimensions: { + width: 100, }, gravity: { compass: "south", - gravityType: "direction" + gravityType: "direction", }, x: 3, - y: 4 + y: 4, }, { actionType: "fill", @@ -160,15 +159,18 @@ describe('resize.toJson()', () => { gravity: { gravityType: "ocr", }, - } - ] + }, + ], }); }); - it('should generate auto gravity model', () => { - const transformation = new Transformation() - .addAction(Resize.fill().width(100).height(100).gravity(autoGravity().autoFocus(AutoFocus.focusOn(face()))) - ); + it("should generate auto gravity model", () => { + const transformation = new Transformation().addAction( + Resize.fill() + .width(100) + .height(100) + .gravity(autoGravity().autoFocus(AutoFocus.focusOn(face()))) + ); const model = transformation.toJson(); @@ -176,25 +178,26 @@ describe('resize.toJson()', () => { actions: [ { actionType: "fill", - dimensions: {width: 100, height: 100}, + dimensions: { width: 100, height: 100 }, gravity: { - gravityType: 'auto', - autoFocus: [ - {object: "face"} - ] - } - } - ] + gravityType: "auto", + autoFocus: [{ object: "face" }], + }, + }, + ], }); }); - it('should generate auto gravity model', () => { - const transformation = new Transformation() - .addAction(Resize.crop(200).gravity(Gravity.autoGravity().autoFocus( - AutoFocus.focusOn(FocusOn.person()).weight(100), - AutoFocus.focusOn(FocusOn.cat()).weight(50).avoid(), - AutoFocus.focusOn(FocusOn.face()).weight(50).avoid() - ))); + it("should generate auto gravity model", () => { + const transformation = new Transformation().addAction( + Resize.crop(200).gravity( + Gravity.autoGravity().autoFocus( + AutoFocus.focusOn(FocusOn.person()).weight(100), + AutoFocus.focusOn(FocusOn.cat()).weight(50).avoid(), + AutoFocus.focusOn(FocusOn.face()).weight(50).avoid() + ) + ) + ); const model = transformation.toJson(); @@ -202,219 +205,236 @@ describe('resize.toJson()', () => { actions: [ { actionType: "crop", - dimensions: {width: 200}, + dimensions: { width: 200 }, gravity: { - gravityType: 'auto', + gravityType: "auto", autoFocus: [ - {object: "person", weight: 100}, - {object: "cat", avoid: true}, - {object: "face", avoid: true} - ] - } - } - ] + { object: "person", weight: 100 }, + { object: "cat", avoid: true }, + { object: "face", avoid: true }, + ], + }, + }, + ], }); }); - it('should generate focusOnGravity model', () => { - const transformation = new Transformation() - .addAction(Resize.crop(200).gravity( + it("should generate focusOnGravity model", () => { + const transformation = new Transformation().addAction( + Resize.crop(200).gravity( Gravity.focusOn(FocusOn.cat(), FocusOn.dog()).fallbackGravity( Gravity.autoGravity().autoFocus( AutoFocus.focusOn(FocusOn.microwave()).weight(30), AutoFocus.focusOn(FocusOn.bicycle()).avoid() ) - ))); + ) + ) + ); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'crop', - dimensions: {width: 200}, + actionType: "crop", + dimensions: { width: 200 }, gravity: { - gravityType: 'object', - focusOnObjects: ['cat', 'dog'], + gravityType: "object", + focusOnObjects: ["cat", "dog"], fallbackGravity: { - gravityType: 'auto', + gravityType: "auto", autoFocus: [ - {object: 'microwave', weight: 30}, - {object: 'bicycle', avoid: true} - ] - } - } - } - ] + { object: "microwave", weight: 30 }, + { object: "bicycle", avoid: true }, + ], + }, + }, + }, + ], }); }); - it('should generate an AutoBackgroundModel', () => { - const transformation = new Transformation() - .addAction(Resize.pad(200).background(Background.auto())); + it("should generate an AutoBackgroundModel", () => { + const transformation = new Transformation().addAction(Resize.pad(200).background(Background.auto())); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 200 + width: 200, }, background: { - backgroundType: 'auto' - } - } - ] + backgroundType: "auto", + }, + }, + ], }); }); - it('should generate a BlurredBackgroundModel', () => { - const transformation = new Transformation() - .addAction(Resize.pad(200).background(Background.blurred().intensity(10).brightness(20))); + it("should generate a BlurredBackgroundModel", () => { + const transformation = new Transformation().addAction( + Resize.pad(200).background(Background.blurred().intensity(10).brightness(20)) + ); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 200 + width: 200, }, background: { - backgroundType: 'blurred', + backgroundType: "blurred", brightness: 20, - intensity: 10 - } - } - ] + intensity: 10, + }, + }, + ], }); }); - it('should generate a BorderBackgroundModel', () => { - const transformation = new Transformation() - .addAction(Resize.pad(200).background(Background.border().contrast().palette('RED', 'GREEN', 'BLUE'))); + it("should generate a BorderBackgroundModel", () => { + const transformation = new Transformation().addAction( + Resize.pad(200).background(Background.border().contrast().palette("RED", "GREEN", "BLUE")) + ); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 200 + width: 200, }, background: { - backgroundType: 'border', - palette: ['RED', 'GREEN', 'BLUE'], - contrast: true - } - } - ] + backgroundType: "border", + palette: ["RED", "GREEN", "BLUE"], + contrast: true, + }, + }, + ], }); }); - it('should generate a BorderGradientBackgroundModel', () => { - const transformation = new Transformation() - .addAction(Resize.pad(200).background(Background.borderGradient().contrast().palette('RED', 'GREEN', 'BLUE').gradientColors(2).gradientDirection(GradientDirection.diagonalAsc()))); + it("should generate a BorderGradientBackgroundModel", () => { + const transformation = new Transformation().addAction( + Resize.pad(200).background( + Background.borderGradient() + .contrast() + .palette("RED", "GREEN", "BLUE") + .gradientColors(2) + .gradientDirection(GradientDirection.diagonalAsc()) + ) + ); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 200 + width: 200, }, background: { - backgroundType: 'borderGradient', - palette: ['RED', 'GREEN', 'BLUE'], + backgroundType: "borderGradient", + palette: ["RED", "GREEN", "BLUE"], contrast: true, gradientColors: 2, - gradientDirection: 'diagonal_asc' - } - } - ] + gradientDirection: "diagonal_asc", + }, + }, + ], }); }); - it('should generate a PredominantBackgroundModel', () => { - const transformation = new Transformation() - .addAction(Resize.pad(200).background(Background.predominant().contrast().palette('RED', 'GREEN', 'BLUE'))); + it("should generate a PredominantBackgroundModel", () => { + const transformation = new Transformation().addAction( + Resize.pad(200).background(Background.predominant().contrast().palette("RED", "GREEN", "BLUE")) + ); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 200 + width: 200, }, background: { - backgroundType: 'predominant', - palette: ['RED', 'GREEN', 'BLUE'], - contrast: true - } - } - ] + backgroundType: "predominant", + palette: ["RED", "GREEN", "BLUE"], + contrast: true, + }, + }, + ], }); }); - it('should generate a PredominantGradientBackgroundModel', () => { - const transformation = new Transformation() - .addAction(Resize.pad(200).background(Background.predominantGradient().contrast().palette('RED', 'GREEN', 'BLUE').gradientColors(2).gradientDirection(GradientDirection.diagonalAsc()))); + it("should generate a PredominantGradientBackgroundModel", () => { + const transformation = new Transformation().addAction( + Resize.pad(200).background( + Background.predominantGradient() + .contrast() + .palette("RED", "GREEN", "BLUE") + .gradientColors(2) + .gradientDirection(GradientDirection.diagonalAsc()) + ) + ); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 200 + width: 200, }, background: { - backgroundType: 'predominantGradient', - palette: ['RED', 'GREEN', 'BLUE'], + backgroundType: "predominantGradient", + palette: ["RED", "GREEN", "BLUE"], contrast: true, gradientColors: 2, - gradientDirection: 'diagonal_asc' - } - } - ] + gradientDirection: "diagonal_asc", + }, + }, + ], }); }); - it('should generate a ColorBackgroundModel', () => { - const transformation = new Transformation() - .addAction(Resize.pad(200).background(Background.color('red'))); + it("should generate a ColorBackgroundModel", () => { + const transformation = new Transformation().addAction(Resize.pad(200).background(Background.color("red"))); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 200 + width: 200, }, background: { - backgroundType: 'color', - color: 'red' - } - } - ] + backgroundType: "color", + color: "red", + }, + }, + ], }); }); - it('should generate gravity model for string', () => { + it("should generate gravity model for string", () => { const transformation = new Transformation() - .addAction(Resize.fill(200).gravity('face')) - .addAction(Resize.fill(200).gravity('auto:face')); + .addAction(Resize.fill(200).gravity("face")) + .addAction(Resize.fill(200).gravity("auto:face")); const model = transformation.toJson(); @@ -423,12 +443,12 @@ describe('resize.toJson()', () => { { actionType: "fill", dimensions: { - width: 200 + width: 200, }, gravity: { focusOnObjects: ["face"], - gravityType: "object" - } + gravityType: "object", + }, }, { actionType: "fill", @@ -436,45 +456,43 @@ describe('resize.toJson()', () => { width: 200, }, gravity: { - gravityType: 'auto', - autoFocus: [ - {object: "face"} - ] - } - } - ] + gravityType: "auto", + autoFocus: [{ object: "face" }], + }, + }, + ], }); }); - it('should generate a Generative Fill background', () => { + it("should generate a Generative Fill background", () => { const transformation = new Transformation() - .addAction(Resize.pad(400).background('gen_fill')) - .addAction(Resize.pad(200).background('gen_fill:prompt_strawberry donuts')); + .addAction(Resize.pad(400).background("gen_fill")) + .addAction(Resize.pad(200).background("gen_fill:prompt_strawberry donuts")); const model = transformation.toJson(); expect(model).toStrictEqual({ actions: [ { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 400 + width: 400, }, background: { - backgroundType: 'generativeFill' - } + backgroundType: "generativeFill", + }, }, { - actionType: 'pad', + actionType: "pad", dimensions: { - width: 200 + width: 200, }, background: { - backgroundType: 'generativeFill', - prompt: 'strawberry donuts' - } + backgroundType: "generativeFill", + prompt: "strawberry donuts", + }, }, - ] + ], }); }); }); diff --git a/__TESTS__/unit/toJson/rotate.toJson.test.ts b/__TESTS__/unit/toJson/rotate.toJson.test.ts index cb190a6..08e5848 100644 --- a/__TESTS__/unit/toJson/rotate.toJson.test.ts +++ b/__TESTS__/unit/toJson/rotate.toJson.test.ts @@ -1,17 +1,16 @@ -import {Transformation} from "../../../src"; -import {Rotate} from "../../../src/actions/rotate"; +import { Transformation } from "../../../src"; +import { Rotate } from "../../../src/actions/rotate"; -describe('Rotate toJson()', () => { - it('rotateByAngle', () => { - const transformation = new Transformation() - .addAction(Rotate.byAngle(7)); +describe("Rotate toJson()", () => { + it("rotateByAngle", () => { + const transformation = new Transformation().addAction(Rotate.byAngle(7)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'rotateByAngle', - angle: 7 - } - ] + actionType: "rotateByAngle", + angle: 7, + }, + ], }); }); }); diff --git a/__TESTS__/unit/toJson/roundCorners.toJson.test.ts b/__TESTS__/unit/toJson/roundCorners.toJson.test.ts index 9003a44..95efd2a 100644 --- a/__TESTS__/unit/toJson/roundCorners.toJson.test.ts +++ b/__TESTS__/unit/toJson/roundCorners.toJson.test.ts @@ -1,8 +1,8 @@ -import {Transformation} from "../../../src"; -import {RoundCorners} from "../../../src/actions"; +import { Transformation } from "../../../src"; +import { RoundCorners } from "../../../src/actions"; -describe('RoundCorners toJson()', () => { - it('roundCorners', () => { +describe("RoundCorners toJson()", () => { + it("roundCorners", () => { const transformation = new Transformation() .addAction(RoundCorners.byRadius(10)) .addAction(RoundCorners.byRadius(10, 20, 30, 40)) @@ -11,18 +11,18 @@ describe('RoundCorners toJson()', () => { expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'roundCorners', - radius: [10] + actionType: "roundCorners", + radius: [10], }, { - actionType: 'roundCorners', - radius: [10, 20, 30, 40] + actionType: "roundCorners", + radius: [10, 20, 30, 40], }, { - actionType: 'roundCorners', - radius: 'max' - } - ] + actionType: "roundCorners", + radius: "max", + }, + ], }); }); }); diff --git a/__TESTS__/unit/toJson/toJson.test.ts b/__TESTS__/unit/toJson/toJson.test.ts index 7882575..64eae38 100644 --- a/__TESTS__/unit/toJson/toJson.test.ts +++ b/__TESTS__/unit/toJson/toJson.test.ts @@ -1,16 +1,12 @@ -import {Transformation} from "../../../src"; -import {Action} from "../../../src/internal/Action"; -import {UnsupportedError} from "../../../src/internal/utils/unsupportedError"; +import { Transformation } from "../../../src"; +import { Action } from "../../../src/internal/Action"; +import { UnsupportedError } from "../../../src/internal/utils/unsupportedError"; -describe('Transformation.toJson()', () => { - it('unsupported actions', () => { - const transformation = new Transformation() - .addAction(new Action()) - .addAction(new Action()); - expect(transformation.toJson()).toStrictEqual( - { - error: new UnsupportedError('unsupported action Action') - } - ); +describe("Transformation.toJson()", () => { + it("unsupported actions", () => { + const transformation = new Transformation().addAction(new Action()).addAction(new Action()); + expect(transformation.toJson()).toStrictEqual({ + error: new UnsupportedError("unsupported action Action"), + }); }); }); diff --git a/__TESTS__/unit/toJson/transcode.toJson.test.ts b/__TESTS__/unit/toJson/transcode.toJson.test.ts index b785f1b..7783cce 100644 --- a/__TESTS__/unit/toJson/transcode.toJson.test.ts +++ b/__TESTS__/unit/toJson/transcode.toJson.test.ts @@ -1,186 +1,167 @@ -import {Transformation} from "../../../src"; -import {Transcode} from "../../../src/actions/transcode"; -import {AudioCodec} from "../../../src/qualifiers/audioCodec"; -import {AudioFrequency} from "../../../src/qualifiers/audioFrequency"; -import {AnimatedFormat} from "../../../src/qualifiers/animatedFormat"; -import {VideoCodec} from "../../../src/qualifiers/videoCodec"; -import {VideoCodecProfile} from "../../../src/qualifiers/videoCodecProfile"; -import {VideoCodecLevel} from "../../../src/qualifiers/videoCodecLevel"; +import { Transformation } from "../../../src"; +import { Transcode } from "../../../src/actions/transcode"; +import { AudioCodec } from "../../../src/qualifiers/audioCodec"; +import { AudioFrequency } from "../../../src/qualifiers/audioFrequency"; +import { AnimatedFormat } from "../../../src/qualifiers/animatedFormat"; +import { VideoCodec } from "../../../src/qualifiers/videoCodec"; +import { VideoCodecProfile } from "../../../src/qualifiers/videoCodecProfile"; +import { VideoCodecLevel } from "../../../src/qualifiers/videoCodecLevel"; -describe('Transcode toJson()', () => { - it('transcode.keyframeInterval number', () => { - const transformation = new Transformation() - .addAction(Transcode.keyframeInterval(4)); +describe("Transcode toJson()", () => { + it("transcode.keyframeInterval number", () => { + const transformation = new Transformation().addAction(Transcode.keyframeInterval(4)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'keyframeInterval', - interval: 4 - } - ] + actionType: "keyframeInterval", + interval: 4, + }, + ], }); }); - it('transcode.fps', () => { - const transformation = new Transformation() - .addAction(Transcode.fps(4)); + it("transcode.fps", () => { + const transformation = new Transformation().addAction(Transcode.fps(4)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'fps', - fps: 4 - } - ] + actionType: "fps", + fps: 4, + }, + ], }); }); - it('transcode.fpsRange', () => { - const transformation = new Transformation() - .addAction(Transcode.fpsRange(4, 7)); + it("transcode.fpsRange", () => { + const transformation = new Transformation().addAction(Transcode.fpsRange(4, 7)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'fps', - fps: {from: 4, to: 7} - } - ] + actionType: "fps", + fps: { from: 4, to: 7 }, + }, + ], }); }); - it('transcode.fpsRange from', () => { - const transformation = new Transformation() - .addAction(Transcode.fpsRange(4)); + it("transcode.fpsRange from", () => { + const transformation = new Transformation().addAction(Transcode.fpsRange(4)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'fps', - fps: {from: 4} - } - ] + actionType: "fps", + fps: { from: 4 }, + }, + ], }); }); - it('transcode.bitRate', () => { - const transformation = new Transformation() - .addAction(Transcode.bitRate('500k')); + it("transcode.bitRate", () => { + const transformation = new Transformation().addAction(Transcode.bitRate("500k")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'bitRate', - bitRate: '500k' - } - ] + actionType: "bitRate", + bitRate: "500k", + }, + ], }); }); - it('transcode.bitRate.constant', () => { - const transformation = new Transformation() - .addAction(Transcode.bitRate('500k').constant()); + it("transcode.bitRate.constant", () => { + const transformation = new Transformation().addAction(Transcode.bitRate("500k").constant()); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'bitRate', - bitRate: '500k', - constant: true - } - ] + actionType: "bitRate", + bitRate: "500k", + constant: true, + }, + ], }); }); - it('transcode.audioCodec', () => { - const transformation = new Transformation() - .addAction(Transcode.audioCodec(AudioCodec.aac())); + it("transcode.audioCodec", () => { + const transformation = new Transformation().addAction(Transcode.audioCodec(AudioCodec.aac())); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'audioCodec', - audioCodec: 'aac', - } - ] + actionType: "audioCodec", + audioCodec: "aac", + }, + ], }); }); - it('transcode.audioFrequency', () => { - const transformation = new Transformation() - .addAction(Transcode - .audioFrequency('freq8000')); + it("transcode.audioFrequency", () => { + const transformation = new Transformation().addAction(Transcode.audioFrequency("freq8000")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'audioFrequency', - audioFrequencyType: 'freq8000', - } - ] + actionType: "audioFrequency", + audioFrequencyType: "freq8000", + }, + ], }); }); - it('transcode.streamingProfile', () => { - const transformation = new Transformation() - .addAction(Transcode - .streamingProfile("full_hd")); + it("transcode.streamingProfile", () => { + const transformation = new Transformation().addAction(Transcode.streamingProfile("full_hd")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'streamingProfile', - profile: 'fullHd', - } - ] + actionType: "streamingProfile", + profile: "fullHd", + }, + ], }); }); - it('transcode.animatedFormat', () => { - const transformation = new Transformation() - .addAction(Transcode - .toAnimated('gif').delay(20).sampling('4s')); + it("transcode.animatedFormat", () => { + const transformation = new Transformation().addAction(Transcode.toAnimated("gif").delay(20).sampling("4s")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'toAnimated', - animatedFormat: 'gif', + actionType: "toAnimated", + animatedFormat: "gif", delay: 20, - sampling: '4s' - } - ] + sampling: "4s", + }, + ], }); }); - it('transcode.videoCodec', () => { - const transformation = new Transformation() - .addAction(Transcode.videoCodec( - VideoCodec.h264() - )); + it("transcode.videoCodec", () => { + const transformation = new Transformation().addAction(Transcode.videoCodec(VideoCodec.h264())); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'videoCodec', + actionType: "videoCodec", videoCodec: { - videoCodecName: 'h264' - } - } - ] + videoCodecName: "h264", + }, + }, + ], }); }); - it('transcode.videoCodec advanced', () => { - const transformation = new Transformation() - .addAction(Transcode.videoCodec( - VideoCodec.h264() - .profile(VideoCodecProfile.baseline()) - .level(VideoCodecLevel.vcl31()) - )); + it("transcode.videoCodec advanced", () => { + const transformation = new Transformation().addAction( + Transcode.videoCodec(VideoCodec.h264().profile(VideoCodecProfile.baseline()).level(VideoCodecLevel.vcl31())) + ); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'videoCodec', + actionType: "videoCodec", videoCodec: { - videoCodecName: 'h264', - profile: 'baseline', - level: 3.1 - } - } - ] + videoCodecName: "h264", + profile: "baseline", + level: 3.1, + }, + }, + ], }); }); }); diff --git a/__TESTS__/unit/toJson/videoEditTrim.toJson.test.ts b/__TESTS__/unit/toJson/videoEditTrim.toJson.test.ts index ee9f6f6..dfef8ad 100644 --- a/__TESTS__/unit/toJson/videoEditTrim.toJson.test.ts +++ b/__TESTS__/unit/toJson/videoEditTrim.toJson.test.ts @@ -1,53 +1,42 @@ -import {Transformation} from '../../../src'; -import {VideoEdit} from "../../../src/actions"; +import { Transformation } from "../../../src"; +import { VideoEdit } from "../../../src/actions"; -describe('videoEdit.trim toJson', () => { - it('videoEdit.trim with duration', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.trim() - .duration('30%') - ); +describe("videoEdit.trim toJson", () => { + it("videoEdit.trim with duration", () => { + const transformation = new Transformation().videoEdit(VideoEdit.trim().duration("30%")); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'trimVideo', - duration: '30%', - } - ] + actionType: "trimVideo", + duration: "30%", + }, + ], }); }); - it('videoEdit.trim with startOffset and endOffset', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.trim() - .startOffset(3) - .endOffset(5) - ); + it("videoEdit.trim with startOffset and endOffset", () => { + const transformation = new Transformation().videoEdit(VideoEdit.trim().startOffset(3).endOffset(5)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'trimVideo', + actionType: "trimVideo", startOffset: 3, endOffset: 5, - } - ] + }, + ], }); }); - it('videoEdit.trim with startOffset and duration', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.trim() - .startOffset(3) - .duration(5) - ); + it("videoEdit.trim with startOffset and duration", () => { + const transformation = new Transformation().videoEdit(VideoEdit.trim().startOffset(3).duration(5)); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'trimVideo', + actionType: "trimVideo", startOffset: 3, duration: 5, - } - ] + }, + ], }); }); }); diff --git a/__TESTS__/unit/toJson/volume.toJson.test.ts b/__TESTS__/unit/toJson/volume.toJson.test.ts index 1b1b1cd..01eacc6 100644 --- a/__TESTS__/unit/toJson/volume.toJson.test.ts +++ b/__TESTS__/unit/toJson/volume.toJson.test.ts @@ -1,55 +1,49 @@ -import {Transformation} from '../../../src'; -import {VideoEdit} from "../../../src/actions"; -import {byDecibels, byPercent, mute} from "../../../src/qualifiers/volume"; +import { Transformation } from "../../../src"; +import { VideoEdit } from "../../../src/actions"; +import { byDecibels, byPercent, mute } from "../../../src/qualifiers/volume"; -describe('videoEdit.trim toJson', () => { - it('videoEdit.volume with decibels', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.volume(byDecibels(10)) - ); +describe("videoEdit.trim toJson", () => { + it("videoEdit.volume with decibels", () => { + const transformation = new Transformation().videoEdit(VideoEdit.volume(byDecibels(10))); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'volume', + actionType: "volume", volumeValue: { - mode: 'decibels', - value: 10 - } - } - ] + mode: "decibels", + value: 10, + }, + }, + ], }); }); - it('videoEdit.volume with percent', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.volume(byPercent(10)) - ); + it("videoEdit.volume with percent", () => { + const transformation = new Transformation().videoEdit(VideoEdit.volume(byPercent(10))); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'volume', + actionType: "volume", volumeValue: { - mode: 'percent', - value: 10 - } - } - ] + mode: "percent", + value: 10, + }, + }, + ], }); }); - it('videoEdit.volume with mute', () => { - const transformation = new Transformation() - .videoEdit(VideoEdit.volume(mute()) - ); + it("videoEdit.volume with mute", () => { + const transformation = new Transformation().videoEdit(VideoEdit.volume(mute())); expect(transformation.toJson()).toStrictEqual({ actions: [ { - actionType: 'volume', + actionType: "volume", volumeValue: { - mode: 'mute' - } - } - ] + mode: "mute", + }, + }, + ], }); }); }); diff --git a/__TESTS__/unit/transformation/ImageTransformation.test.ts b/__TESTS__/unit/transformation/ImageTransformation.test.ts index 10f2f83..04987ac 100644 --- a/__TESTS__/unit/transformation/ImageTransformation.test.ts +++ b/__TESTS__/unit/transformation/ImageTransformation.test.ts @@ -1,13 +1,12 @@ -import {ImageTransformation} from "../../../src/transformation/ImageTransformation"; +import { ImageTransformation } from "../../../src/transformation/ImageTransformation"; - -describe('Tests for ImageTransformation', () => { +describe("Tests for ImageTransformation", () => { let tImage: ImageTransformation = null; beforeEach(() => { tImage = new ImageTransformation(); }); - it('Instantiates a ImageTransformation', () => { + it("Instantiates a ImageTransformation", () => { expect(tImage).toBeDefined(); }); diff --git a/__TESTS__/unit/transformation/VideoTransformation.test.ts b/__TESTS__/unit/transformation/VideoTransformation.test.ts index 8fec496..8176f14 100644 --- a/__TESTS__/unit/transformation/VideoTransformation.test.ts +++ b/__TESTS__/unit/transformation/VideoTransformation.test.ts @@ -1,12 +1,12 @@ -import {VideoTransformation} from "../../../src/transformation/VideoTransformation"; +import { VideoTransformation } from "../../../src/transformation/VideoTransformation"; -describe('Tests for VideoTransformation', () => { +describe("Tests for VideoTransformation", () => { let tVideo: VideoTransformation = null; beforeEach(() => { tVideo = new VideoTransformation(); }); - it('Instantiates a VideoTransformation', () => { + it("Instantiates a VideoTransformation", () => { expect(tVideo).toBeDefined(); }); diff --git a/__TESTS__/unit/transformation/transformation.test.ts b/__TESTS__/unit/transformation/transformation.test.ts index adf2e1f..2e59f6d 100644 --- a/__TESTS__/unit/transformation/transformation.test.ts +++ b/__TESTS__/unit/transformation/transformation.test.ts @@ -1,33 +1,33 @@ -import {Transformation} from "../../../src/transformation/Transformation"; -import {scale} from "../../../src/actions/resize"; +import { Transformation } from "../../../src/transformation/Transformation"; +import { scale } from "../../../src/actions/resize"; -describe('Tests for ImageTransformation', () => { +describe("Tests for ImageTransformation", () => { let tx: Transformation = null; beforeEach(() => { tx = new Transformation(); }); - it('Instantiates a ImageTransformation', () => { + it("Instantiates a ImageTransformation", () => { expect(tx).toBeDefined(); }); - it('Accepts a raw transformation', () => { - tx.addTransformation('w_100/w_200/w_300'); - expect(tx.toString()).toContain('w_100/w_200/w_300'); + it("Accepts a raw transformation", () => { + tx.addTransformation("w_100/w_200/w_300"); + expect(tx.toString()).toContain("w_100/w_200/w_300"); }); - it('Accepts a transforamtion instance to addTransformation', () => { + it("Accepts a transforamtion instance to addTransformation", () => { const tx1 = new Transformation().resize(scale().width(100)); const tx2 = new Transformation().resize(scale().width(500)); tx2.addTransformation(tx1); tx2.resize(scale().width(200)); - expect(tx2.toString()).toContain('c_scale,w_500/c_scale,w_100/c_scale,w_200'); + expect(tx2.toString()).toContain("c_scale,w_500/c_scale,w_100/c_scale,w_200"); }); - it('Throws when passing a slash to an action', () => { + it("Throws when passing a slash to an action", () => { expect(() => { - tx.addAction('w_100/w_200/w_300'); + tx.addAction("w_100/w_200/w_300"); }).toThrow(); }); }); diff --git a/__TESTS__/unit/types/BlendMode.test.ts b/__TESTS__/unit/types/BlendMode.test.ts index b4709e5..5013f69 100644 --- a/__TESTS__/unit/types/BlendMode.test.ts +++ b/__TESTS__/unit/types/BlendMode.test.ts @@ -1,15 +1,14 @@ -import {BlendMode} from "../../../src/qualifiers/blendMode"; +import { BlendMode } from "../../../src/qualifiers/blendMode"; - -describe('BlendMode Qualifier', () => { - it('Tests simple gravitation', () => { - expect(BlendMode.screen().toString()).toBe('e_screen'); - expect(BlendMode.multiply().toString()).toBe('e_multiply'); - expect(BlendMode.overlay().toString()).toBe('e_overlay'); - expect(BlendMode.mask().toString()).toBe('e_mask'); - expect(BlendMode.antiRemoval().toString()).toBe('e_anti_removal'); +describe("BlendMode Qualifier", () => { + it("Tests simple gravitation", () => { + expect(BlendMode.screen().toString()).toBe("e_screen"); + expect(BlendMode.multiply().toString()).toBe("e_multiply"); + expect(BlendMode.overlay().toString()).toBe("e_overlay"); + expect(BlendMode.mask().toString()).toBe("e_mask"); + expect(BlendMode.antiRemoval().toString()).toBe("e_anti_removal"); }); - it('Test antiRemoval with input', () => { - expect(BlendMode.antiRemoval(95).toString()).toBe('e_anti_removal:95'); + it("Test antiRemoval with input", () => { + expect(BlendMode.antiRemoval(95).toString()).toBe("e_anti_removal:95"); }); }); diff --git a/__TESTS__/unit/types/Position.test.ts b/__TESTS__/unit/types/Position.test.ts index a9e0560..6a482ec 100644 --- a/__TESTS__/unit/types/Position.test.ts +++ b/__TESTS__/unit/types/Position.test.ts @@ -1,21 +1,19 @@ -import {Position} from "../../../src/qualifiers/position"; -import {Gravity} from "../../../src/qualifiers/gravity"; -import {Compass} from "../../../src/qualifiers/compass"; -import {FocusOn} from "../../../src/qualifiers/focusOn"; -import {Overlay} from "../../../src/actions/overlay"; -import {Source} from "../../../src/qualifiers/source"; -import {Transformation} from "../../../src"; - - -describe('Position Qualifier', () => { - it('Tests an empty Position', () => { - const posString = new Position() - .toString(); - - expect(posString).toBe(''); +import { Position } from "../../../src/qualifiers/position"; +import { Gravity } from "../../../src/qualifiers/gravity"; +import { Compass } from "../../../src/qualifiers/compass"; +import { FocusOn } from "../../../src/qualifiers/focusOn"; +import { Overlay } from "../../../src/actions/overlay"; +import { Source } from "../../../src/qualifiers/source"; +import { Transformation } from "../../../src"; + +describe("Position Qualifier", () => { + it("Tests an empty Position", () => { + const posString = new Position().toString(); + + expect(posString).toBe(""); }); - it('Tests the toString() method of Position (Compass Gravity)', () => { + it("Tests the toString() method of Position (Compass Gravity)", () => { const posString = new Position() .allowOverflow(false) .tiled() @@ -24,10 +22,10 @@ describe('Position Qualifier', () => { .offsetY(10) .toString(); - expect(posString).toBe('fl_no_overflow,fl_tiled,g_north,x_10,y_10'); + expect(posString).toBe("fl_no_overflow,fl_tiled,g_north,x_10,y_10"); }); - it('Tests the toString() method of Position (FocusOn Gravity)', () => { + it("Tests the toString() method of Position (FocusOn Gravity)", () => { const posString = new Position() .allowOverflow(false) .tiled() @@ -36,16 +34,12 @@ describe('Position Qualifier', () => { .offsetY(10) .toString(); - expect(posString).toBe('fl_no_overflow,fl_tiled,g_cat,x_10,y_10'); + expect(posString).toBe("fl_no_overflow,fl_tiled,g_cat,x_10,y_10"); }); - it('Tests a tiled overlay', () => { - const tx = new Transformation() - .overlay(Overlay.source(Source.image('sample')) - .position(new Position() - .tiled())); - + it("Tests a tiled overlay", () => { + const tx = new Transformation().overlay(Overlay.source(Source.image("sample")).position(new Position().tiled())); - expect(tx.toString()).toBe('l_sample/fl_layer_apply,fl_tiled'); + expect(tx.toString()).toBe("l_sample/fl_layer_apply,fl_tiled"); }); }); diff --git a/__TESTS__/unit/utils/base64Encode.browser.test.ts b/__TESTS__/unit/utils/base64Encode.browser.test.ts index 2c2140f..4499892 100644 --- a/__TESTS__/unit/utils/base64Encode.browser.test.ts +++ b/__TESTS__/unit/utils/base64Encode.browser.test.ts @@ -1,20 +1,18 @@ /** * @jest-environment jsdom */ -import {base64Encode} from "../../../src/internal/utils/base64Encode"; +import { base64Encode } from "../../../src/internal/utils/base64Encode"; - -describe('base64 test encoding', () => { - it('Encodes foo', () => { - expect(base64Encode('foo')).toBe('Zm9v'); +describe("base64 test encoding", () => { + it("Encodes foo", () => { + expect(base64Encode("foo")).toBe("Zm9v"); }); - it('Encodes ABlasjglkaskfjgkj', () => { - expect(base64Encode('ABlasjglkaskfjgkj')).toBe('QUJsYXNqZ2xrYXNrZmpna2o='); + it("Encodes ABlasjglkaskfjgkj", () => { + expect(base64Encode("ABlasjglkaskfjgkj")).toBe("QUJsYXNqZ2xrYXNrZmpna2o="); }); - - it('Encodes https://www.example.com', () => { - expect(base64Encode('https://www.example.com')).toBe('aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20='); + it("Encodes https://www.example.com", () => { + expect(base64Encode("https://www.example.com")).toBe("aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20="); }); }); diff --git a/__TESTS__/unit/utils/base64Encode.node.test.ts b/__TESTS__/unit/utils/base64Encode.node.test.ts index 97546f8..3064ba3 100644 --- a/__TESTS__/unit/utils/base64Encode.node.test.ts +++ b/__TESTS__/unit/utils/base64Encode.node.test.ts @@ -1,19 +1,18 @@ /** * @jest-environment node */ -import {base64Encode} from "../../../src/internal/utils/base64Encode"; +import { base64Encode } from "../../../src/internal/utils/base64Encode"; -describe('base64 test encoding', () => { - it('Encodes foo', () => { - expect(base64Encode('foo')).toBe('Zm9v'); +describe("base64 test encoding", () => { + it("Encodes foo", () => { + expect(base64Encode("foo")).toBe("Zm9v"); }); - it('Encodes ABlasjglkaskfjgkj', () => { - expect(base64Encode('ABlasjglkaskfjgkj')).toBe('QUJsYXNqZ2xrYXNrZmpna2o='); + it("Encodes ABlasjglkaskfjgkj", () => { + expect(base64Encode("ABlasjglkaskfjgkj")).toBe("QUJsYXNqZ2xrYXNrZmpna2o="); }); - - it('Encodes https://www.example.com', () => { - expect(base64Encode('https://www.example.com')).toBe('aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20='); + it("Encodes https://www.example.com", () => { + expect(base64Encode("https://www.example.com")).toBe("aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20="); }); }); diff --git a/__TESTS__/unit/utils/dataStructureUtils/isString.test.ts b/__TESTS__/unit/utils/dataStructureUtils/isString.test.ts index d1881ed..f3be71e 100644 --- a/__TESTS__/unit/utils/dataStructureUtils/isString.test.ts +++ b/__TESTS__/unit/utils/dataStructureUtils/isString.test.ts @@ -1,10 +1,10 @@ -import {isString} from "../../../../src/internal/utils/dataStructureUtils"; +import { isString } from "../../../../src/internal/utils/dataStructureUtils"; -describe('Tests for isString', () => { - it('checks if a value is a string', () => { +describe("Tests for isString", () => { + it("checks if a value is a string", () => { expect(isString(1)).toBe(false); - expect(isString({a:1})).toBe(false); - expect(isString('1')).toBe(true); - expect(isString(String('1'))).toBe(true); + expect(isString({ a: 1 })).toBe(false); + expect(isString("1")).toBe(true); + expect(isString(String("1"))).toBe(true); }); }); diff --git a/__TESTS__/unit/utils/dataStructureUtils/sortMapByKey.test.ts b/__TESTS__/unit/utils/dataStructureUtils/sortMapByKey.test.ts index a6fcfea..09bfe00 100644 --- a/__TESTS__/unit/utils/dataStructureUtils/sortMapByKey.test.ts +++ b/__TESTS__/unit/utils/dataStructureUtils/sortMapByKey.test.ts @@ -1,12 +1,12 @@ -import {mapToSortedArray} from "../../../../src/internal/utils/dataStructureUtils"; +import { mapToSortedArray } from "../../../../src/internal/utils/dataStructureUtils"; -describe('Tests for sortMapByKey', () => { - it('sorts a map', () => { +describe("Tests for sortMapByKey", () => { + it("sorts a map", () => { const map = new Map(); - map.set('c', 'c'); - map.set('a', 'a'); - map.set('b', 'b'); + map.set("c", "c"); + map.set("a", "a"); + map.set("b", "b"); - expect(mapToSortedArray(map, []).join(',')).toBe('a,b,c'); + expect(mapToSortedArray(map, []).join(",")).toBe("a,b,c"); }); }); diff --git a/__TESTS__/unit/utils/toFloatAsString.test.ts b/__TESTS__/unit/utils/toFloatAsString.test.ts index 986f5c2..6aae7d3 100644 --- a/__TESTS__/unit/utils/toFloatAsString.test.ts +++ b/__TESTS__/unit/utils/toFloatAsString.test.ts @@ -1,34 +1,34 @@ -import {toFloatAsString} from "../../../src/internal/utils/toFloatAsString"; +import { toFloatAsString } from "../../../src/internal/utils/toFloatAsString"; -describe('Tests for toFloatAsString', () => { - it('Test string input', () => { - expect(toFloatAsString('0')).toBe('0.0'); - expect(toFloatAsString('-1')).toBe('-1.0'); - expect(toFloatAsString('1')).toBe('1.0'); - expect(toFloatAsString('1.2')).toBe('1.2'); +describe("Tests for toFloatAsString", () => { + it("Test string input", () => { + expect(toFloatAsString("0")).toBe("0.0"); + expect(toFloatAsString("-1")).toBe("-1.0"); + expect(toFloatAsString("1")).toBe("1.0"); + expect(toFloatAsString("1.2")).toBe("1.2"); }); - it('Test number input', () => { - expect(toFloatAsString(0)).toBe('0.0'); - expect(toFloatAsString(-1)).toBe('-1.0'); - expect(toFloatAsString(1)).toBe('1.0'); - expect(toFloatAsString(1.2)).toBe('1.2'); + it("Test number input", () => { + expect(toFloatAsString(0)).toBe("0.0"); + expect(toFloatAsString(-1)).toBe("-1.0"); + expect(toFloatAsString(1)).toBe("1.0"); + expect(toFloatAsString(1.2)).toBe("1.2"); }); - it('Test string input that is not a number is not changed', () => { - expect(toFloatAsString('0000')).toBe('0000'); - expect(toFloatAsString('0x')).toBe('0x'); - expect(toFloatAsString('.1')).toBe('.1'); - expect(toFloatAsString('1..0')).toBe('1..0'); - expect(toFloatAsString('abcd')).toBe('abcd'); - expect(toFloatAsString('abcd.55')).toBe('abcd.55'); - expect(toFloatAsString('123/abcd')).toBe('123/abcd'); + it("Test string input that is not a number is not changed", () => { + expect(toFloatAsString("0000")).toBe("0000"); + expect(toFloatAsString("0x")).toBe("0x"); + expect(toFloatAsString(".1")).toBe(".1"); + expect(toFloatAsString("1..0")).toBe("1..0"); + expect(toFloatAsString("abcd")).toBe("abcd"); + expect(toFloatAsString("abcd.55")).toBe("abcd.55"); + expect(toFloatAsString("123/abcd")).toBe("123/abcd"); }); - it ('Test input with decimal does not change', () => { - expect(toFloatAsString('1.0')).toBe('1.0'); - expect(toFloatAsString('1.00')).toBe('1.00'); - expect(toFloatAsString('1.2')).toBe('1.2'); - expect(toFloatAsString('1.0005')).toBe('1.0005'); + it("Test input with decimal does not change", () => { + expect(toFloatAsString("1.0")).toBe("1.0"); + expect(toFloatAsString("1.00")).toBe("1.00"); + expect(toFloatAsString("1.2")).toBe("1.2"); + expect(toFloatAsString("1.0005")).toBe("1.0005"); }); }); diff --git a/__TESTS__/unit/values/TextStyle/TextStyle.test.ts b/__TESTS__/unit/values/TextStyle/TextStyle.test.ts index eda9b82..47e701b 100644 --- a/__TESTS__/unit/values/TextStyle/TextStyle.test.ts +++ b/__TESTS__/unit/values/TextStyle/TextStyle.test.ts @@ -1,29 +1,26 @@ -import {TextStyle} from "../../../../src/qualifiers/textStyle"; -import {FontStyle} from "../../../../src/qualifiers/fontStyle"; -import {FontAntialias} from "../../../../src/qualifiers/FontAntialias"; -import {FontWeight} from "../../../../src/qualifiers/fontWeight"; -import {FontHinting} from "../../../../src/qualifiers/fontHinting"; -import {TextDecoration} from "../../../../src/qualifiers/textDecoration"; -import {TextAlignment} from "../../../../src/qualifiers/textAlignment"; -import {Stroke} from "../../../../src/qualifiers/textStroke"; -import {Color} from "../../../../src/qualifiers/color"; +import { TextStyle } from "../../../../src/qualifiers/textStyle"; +import { FontStyle } from "../../../../src/qualifiers/fontStyle"; +import { FontAntialias } from "../../../../src/qualifiers/FontAntialias"; +import { FontWeight } from "../../../../src/qualifiers/fontWeight"; +import { FontHinting } from "../../../../src/qualifiers/fontHinting"; +import { TextDecoration } from "../../../../src/qualifiers/textDecoration"; +import { TextAlignment } from "../../../../src/qualifiers/textAlignment"; +import { Stroke } from "../../../../src/qualifiers/textStroke"; +import { Color } from "../../../../src/qualifiers/color"; -describe('Text Style tests', () => { - it('Create a new instance', () => { - const res = new TextStyle('arial', 50) - .toString(); - expect(res).toBe('arial_50'); +describe("Text Style tests", () => { + it("Create a new instance", () => { + const res = new TextStyle("arial", 50).toString(); + expect(res).toBe("arial_50"); }); - it('Create a new with italic', () => { - const res = new TextStyle('arial', 50) - .fontStyle(FontStyle.italic()) - .toString(); - expect(res).toBe('arial_50_italic'); + it("Create a new with italic", () => { + const res = new TextStyle("arial", 50).fontStyle(FontStyle.italic()).toString(); + expect(res).toBe("arial_50_italic"); }); - it('Create a new with all options', () => { - const res = new TextStyle('arial', 50) + it("Create a new with all options", () => { + const res = new TextStyle("arial", 50) .letterSpacing(10) .lineSpacing(20) .fontAntialias(FontAntialias.good()) @@ -34,34 +31,33 @@ describe('Text Style tests', () => { .stroke() .fontStyle(FontStyle.italic()) .toString(); - expect(res).toBe('arial_50_bold_italic_strikethrough_justify_stroke_letter_spacing_10_line_spacing_20_antialias_good_hinting_full'); + expect(res).toBe( + "arial_50_bold_italic_strikethrough_justify_stroke_letter_spacing_10_line_spacing_20_antialias_good_hinting_full" + ); }); - it('Can use shortened text notation', () => { - const res = new TextStyle('arial', 50) + it("Can use shortened text notation", () => { + const res = new TextStyle("arial", 50) .fontAntialias("good") .fontWeight("bold") .fontStyle("italic") .textDecoration("strikethrough") .textAlignment("center") .toString(); - expect(res).toBe('arial_50_bold_italic_strikethrough_center_antialias_good'); + expect(res).toBe("arial_50_bold_italic_strikethrough_center_antialias_good"); }); - it('Create a new instance with stroke solid', () => { - const res = new TextStyle('arial', 50) - .stroke(Stroke.solid(2, Color.WHITE)) - .toString(); - expect(res).toBe('arial_50_stroke_bo_2px_solid_white'); + it("Create a new instance with stroke solid", () => { + const res = new TextStyle("arial", 50).stroke(Stroke.solid(2, Color.WHITE)).toString(); + expect(res).toBe("arial_50_stroke_bo_2px_solid_white"); }); - - it('Ensure normal is not included in the URL(this is the default)', () => { - const res = new TextStyle('arial', 50) + it("Ensure normal is not included in the URL(this is the default)", () => { + const res = new TextStyle("arial", 50) .fontWeight(FontWeight.normal()) .textDecoration(TextDecoration.normal()) .fontStyle(FontStyle.normal()) .toString(); - expect(res).toBe('arial_50'); + expect(res).toBe("arial_50"); }); }); diff --git a/__TESTS__/unit/values/format/Format.test.ts b/__TESTS__/unit/values/format/Format.test.ts index 42b587b..4ce7058 100644 --- a/__TESTS__/unit/values/format/Format.test.ts +++ b/__TESTS__/unit/values/format/Format.test.ts @@ -1,84 +1,135 @@ -import {Format} from "../../../../src/qualifiers/format"; +import { Format } from "../../../../src/qualifiers/format"; -describe('Test imported qualifiers', () => { - it ('Tests audio formats', () => { - - const {audioAac, audioAiff, audioAmr, audioFlac, audioM4a, audioMp3, audioOgg, audioOpus, audioWav} = Format; - expect(audioAac().toString()).toBe('aac'); - expect(audioAiff().toString()).toBe('aiff'); - expect(audioAmr().toString()).toBe('amr'); - expect(audioFlac().toString()).toBe('flac'); - expect(audioM4a().toString()).toBe('m4a'); - expect(audioMp3().toString()).toBe('mp3'); - expect(audioOgg().toString()).toBe('ogg'); - expect(audioOpus().toString()).toBe('opus'); - expect(audioWav().toString()).toBe('wav'); +describe("Test imported qualifiers", () => { + it("Tests audio formats", () => { + const { audioAac, audioAiff, audioAmr, audioFlac, audioM4a, audioMp3, audioOgg, audioOpus, audioWav } = Format; + expect(audioAac().toString()).toBe("aac"); + expect(audioAiff().toString()).toBe("aiff"); + expect(audioAmr().toString()).toBe("amr"); + expect(audioFlac().toString()).toBe("flac"); + expect(audioM4a().toString()).toBe("m4a"); + expect(audioMp3().toString()).toBe("mp3"); + expect(audioOgg().toString()).toBe("ogg"); + expect(audioOpus().toString()).toBe("opus"); + expect(audioWav().toString()).toBe("wav"); }); - it('Test Video formats', () => { - const {video3g2, video3gp, videoAvi, videoFlv, videoM2ts, videoM3u8, videoMkv, videoMov, videoMp4, videoMpd, - videoMpeg, videoMts, videoMxf, videoOgv, videoTs, videoWebm, videoWmv} = Format; + it("Test Video formats", () => { + const { + video3g2, + video3gp, + videoAvi, + videoFlv, + videoM2ts, + videoM3u8, + videoMkv, + videoMov, + videoMp4, + videoMpd, + videoMpeg, + videoMts, + videoMxf, + videoOgv, + videoTs, + videoWebm, + videoWmv, + } = Format; - expect(video3g2().toString()).toBe('3g2'); - expect(video3gp().toString()).toBe('3gp'); - expect(videoAvi().toString()).toBe('avi'); - expect(videoFlv().toString()).toBe('flv'); - expect(videoM2ts().toString()).toBe('m2ts'); - expect(videoM3u8().toString()).toBe('m3u8'); - expect(videoMkv().toString()).toBe('mkv'); - expect(videoMov().toString()).toBe('mov'); - expect(videoMp4().toString()).toBe('mp4'); - expect(videoMpd().toString()).toBe('mpd'); - expect(videoMpeg().toString()).toBe('mpeg'); - expect(videoMts().toString()).toBe('mts'); - expect(videoMxf().toString()).toBe('mxf'); - expect(videoOgv().toString()).toBe('ogv'); - expect(videoTs().toString()).toBe('ts'); - expect(videoWebm().toString()).toBe('webm'); - expect(videoWmv().toString()).toBe('wmv'); + expect(video3g2().toString()).toBe("3g2"); + expect(video3gp().toString()).toBe("3gp"); + expect(videoAvi().toString()).toBe("avi"); + expect(videoFlv().toString()).toBe("flv"); + expect(videoM2ts().toString()).toBe("m2ts"); + expect(videoM3u8().toString()).toBe("m3u8"); + expect(videoMkv().toString()).toBe("mkv"); + expect(videoMov().toString()).toBe("mov"); + expect(videoMp4().toString()).toBe("mp4"); + expect(videoMpd().toString()).toBe("mpd"); + expect(videoMpeg().toString()).toBe("mpeg"); + expect(videoMts().toString()).toBe("mts"); + expect(videoMxf().toString()).toBe("mxf"); + expect(videoOgv().toString()).toBe("ogv"); + expect(videoTs().toString()).toBe("ts"); + expect(videoWebm().toString()).toBe("webm"); + expect(videoWmv().toString()).toBe("wmv"); }); - - it('Test image formats', () => { - const {jp2, ai, auto, bmp, eps, flif, gif, heic, ico, jpc, jpg, pdf, png, psd, svg, tiff, wdp, webp, arw, - avif, cr2, djvu, eps3, ept, fxb, gltf, hdp, heif, indd, jpe, jpeg, jxr, ps, spd, tga, tif, usdz} = Format; - expect(jp2().toString()).toBe('jp2'); - expect(ai().toString()).toBe('ai'); - expect(auto().toString()).toBe('auto'); - expect(bmp().toString()).toBe('bmp'); - expect(eps().toString()).toBe('eps'); - expect(flif().toString()).toBe('flif'); - expect(gif().toString()).toBe('gif'); - expect(heic().toString()).toBe('heic'); - expect(ico().toString()).toBe('ico'); - expect(jpc().toString()).toBe('jpc'); - expect(jpg().toString()).toBe('jpg'); - expect(pdf().toString()).toBe('pdf'); - expect(png().toString()).toBe('png'); - expect(psd().toString()).toBe('psd'); - expect(svg().toString()).toBe('svg'); - expect(tiff().toString()).toBe('tiff'); - expect(wdp().toString()).toBe('wdp'); - expect(webp().toString()).toBe('webp'); - expect(arw().toString()).toBe('arw'); - expect(avif().toString()).toBe('avif'); - expect(cr2().toString()).toBe('cr2'); - expect(djvu().toString()).toBe('djvu'); - expect(eps3().toString()).toBe('eps3'); - expect(ept().toString()).toBe('ept'); - expect(fxb().toString()).toBe('fxb'); - expect(gltf().toString()).toBe('gltf'); - expect(hdp().toString()).toBe('hdp'); - expect(heif().toString()).toBe('heif'); - expect(indd().toString()).toBe('indd'); - expect(jpe().toString()).toBe('jpe'); - expect(jpeg().toString()).toBe('jpeg'); - expect(jxr().toString()).toBe('jxr'); - expect(ps().toString()).toBe('ps'); - expect(spd().toString()).toBe('spd'); - expect(tga().toString()).toBe('tga'); - expect(tif().toString()).toBe('tif'); - expect(usdz().toString()).toBe('usdz'); + it("Test image formats", () => { + const { + jp2, + ai, + auto, + bmp, + eps, + flif, + gif, + heic, + ico, + jpc, + jpg, + pdf, + png, + psd, + svg, + tiff, + wdp, + webp, + arw, + avif, + cr2, + djvu, + eps3, + ept, + fxb, + gltf, + hdp, + heif, + indd, + jpe, + jpeg, + jxr, + ps, + spd, + tga, + tif, + usdz, + } = Format; + expect(jp2().toString()).toBe("jp2"); + expect(ai().toString()).toBe("ai"); + expect(auto().toString()).toBe("auto"); + expect(bmp().toString()).toBe("bmp"); + expect(eps().toString()).toBe("eps"); + expect(flif().toString()).toBe("flif"); + expect(gif().toString()).toBe("gif"); + expect(heic().toString()).toBe("heic"); + expect(ico().toString()).toBe("ico"); + expect(jpc().toString()).toBe("jpc"); + expect(jpg().toString()).toBe("jpg"); + expect(pdf().toString()).toBe("pdf"); + expect(png().toString()).toBe("png"); + expect(psd().toString()).toBe("psd"); + expect(svg().toString()).toBe("svg"); + expect(tiff().toString()).toBe("tiff"); + expect(wdp().toString()).toBe("wdp"); + expect(webp().toString()).toBe("webp"); + expect(arw().toString()).toBe("arw"); + expect(avif().toString()).toBe("avif"); + expect(cr2().toString()).toBe("cr2"); + expect(djvu().toString()).toBe("djvu"); + expect(eps3().toString()).toBe("eps3"); + expect(ept().toString()).toBe("ept"); + expect(fxb().toString()).toBe("fxb"); + expect(gltf().toString()).toBe("gltf"); + expect(hdp().toString()).toBe("hdp"); + expect(heif().toString()).toBe("heif"); + expect(indd().toString()).toBe("indd"); + expect(jpe().toString()).toBe("jpe"); + expect(jpeg().toString()).toBe("jpeg"); + expect(jxr().toString()).toBe("jxr"); + expect(ps().toString()).toBe("ps"); + expect(spd().toString()).toBe("spd"); + expect(tga().toString()).toBe("tga"); + expect(tif().toString()).toBe("tif"); + expect(usdz().toString()).toBe("usdz"); }); }); - diff --git a/__TESTS__/unit/values/gravity/AutoGravity.test.ts b/__TESTS__/unit/values/gravity/AutoGravity.test.ts index 895ee8a..e34817a 100644 --- a/__TESTS__/unit/values/gravity/AutoGravity.test.ts +++ b/__TESTS__/unit/values/gravity/AutoGravity.test.ts @@ -1,33 +1,31 @@ -import {Gravity} from "../../../../src/qualifiers/gravity"; -import {AutoFocus} from "../../../../src/qualifiers/autoFocus"; -import {FocusOn} from "../../../../src/qualifiers/focusOn"; +import { Gravity } from "../../../../src/qualifiers/gravity"; +import { AutoFocus } from "../../../../src/qualifiers/autoFocus"; +import { FocusOn } from "../../../../src/qualifiers/focusOn"; -describe('Gravity Qualifier', () => { - it('AutoGravity should return g_auto by default', () => { +describe("Gravity Qualifier", () => { + it("AutoGravity should return g_auto by default", () => { const gAutoStr = Gravity.autoGravity().toString(); - expect(gAutoStr).toBe('g_auto'); + expect(gAutoStr).toBe("g_auto"); }); - it('AutoGravity with focus should return g_auto:{obj}', () => { + it("AutoGravity with focus should return g_auto:{obj}", () => { const gAutoStr = Gravity.autoGravity().autoFocus(AutoFocus.focusOn(FocusOn.person())).toString(); - expect(gAutoStr).toBe('g_auto:person'); + expect(gAutoStr).toBe("g_auto:person"); }); - it('AutoGravity with focus should return g_auto:{obj}:{obj}', () => { - const gAutoStr = Gravity.autoGravity().autoFocus( - AutoFocus.focusOn(FocusOn.person()), - AutoFocus.focusOn(FocusOn.cat()) - ).toString(); + it("AutoGravity with focus should return g_auto:{obj}:{obj}", () => { + const gAutoStr = Gravity.autoGravity() + .autoFocus(AutoFocus.focusOn(FocusOn.person()), AutoFocus.focusOn(FocusOn.cat())) + .toString(); - expect(gAutoStr).toBe('g_auto:person:cat'); + expect(gAutoStr).toBe("g_auto:person:cat"); }); - it('AutoGravity with weight and avoid', () => { - const gAutoStr = Gravity.autoGravity().autoFocus( - AutoFocus.focusOn(FocusOn.person()).weight(100), - AutoFocus.focusOn(FocusOn.cat()).avoid() - ).toString(); + it("AutoGravity with weight and avoid", () => { + const gAutoStr = Gravity.autoGravity() + .autoFocus(AutoFocus.focusOn(FocusOn.person()).weight(100), AutoFocus.focusOn(FocusOn.cat()).avoid()) + .toString(); - expect(gAutoStr).toBe('g_auto:person_100:cat_avoid'); + expect(gAutoStr).toBe("g_auto:person_100:cat_avoid"); }); }); diff --git a/__TESTS__/unit/values/gravity/CompassGravity.test.ts b/__TESTS__/unit/values/gravity/CompassGravity.test.ts index 4d2fb29..48d42b8 100644 --- a/__TESTS__/unit/values/gravity/CompassGravity.test.ts +++ b/__TESTS__/unit/values/gravity/CompassGravity.test.ts @@ -1,22 +1,22 @@ -import {Compass} from "../../../../src/qualifiers/compass"; -import {Gravity} from "../../../../src/qualifiers/gravity"; +import { Compass } from "../../../../src/qualifiers/compass"; +import { Gravity } from "../../../../src/qualifiers/gravity"; -describe('Tests for Compass Gravity', () => { - it('Expects Gravity to return g_{direction}', () => { - expect(Compass.north().toString()).toBe('north'); - expect(Gravity.compass(Compass.north()).toString()).toBe('g_north'); - expect(Gravity.compass(Compass.center()).toString()).toBe('g_center'); - expect(Gravity.compass(Compass.east()).toString()).toBe('g_east'); - expect(Gravity.compass(Compass.west()).toString()).toBe('g_west'); - expect(Gravity.compass(Compass.north()).toString()).toBe('g_north'); - expect(Gravity.compass(Compass.south()).toString()).toBe('g_south'); - expect(Gravity.compass(Compass.northWest()).toString()).toBe('g_north_west'); - expect(Gravity.compass(Compass.southWest()).toString()).toBe('g_south_west'); - expect(Gravity.compass(Compass.southEast()).toString()).toBe('g_south_east'); - expect(Gravity.compass(Compass.northEast()).toString()).toBe('g_north_east'); +describe("Tests for Compass Gravity", () => { + it("Expects Gravity to return g_{direction}", () => { + expect(Compass.north().toString()).toBe("north"); + expect(Gravity.compass(Compass.north()).toString()).toBe("g_north"); + expect(Gravity.compass(Compass.center()).toString()).toBe("g_center"); + expect(Gravity.compass(Compass.east()).toString()).toBe("g_east"); + expect(Gravity.compass(Compass.west()).toString()).toBe("g_west"); + expect(Gravity.compass(Compass.north()).toString()).toBe("g_north"); + expect(Gravity.compass(Compass.south()).toString()).toBe("g_south"); + expect(Gravity.compass(Compass.northWest()).toString()).toBe("g_north_west"); + expect(Gravity.compass(Compass.southWest()).toString()).toBe("g_south_west"); + expect(Gravity.compass(Compass.southEast()).toString()).toBe("g_south_east"); + expect(Gravity.compass(Compass.northEast()).toString()).toBe("g_north_east"); }); - it('Should accept string as input', () => { - expect(Gravity.compass('north_west').toString()).toBe('g_north_west'); + it("Should accept string as input", () => { + expect(Gravity.compass("north_west").toString()).toBe("g_north_west"); }); }); diff --git a/__TESTS__/unit/values/gravity/FocusOnGravity.test.ts b/__TESTS__/unit/values/gravity/FocusOnGravity.test.ts index f3c2fec..6c90dc4 100644 --- a/__TESTS__/unit/values/gravity/FocusOnGravity.test.ts +++ b/__TESTS__/unit/values/gravity/FocusOnGravity.test.ts @@ -1,66 +1,60 @@ -import {FocusOn} from "../../../../src/qualifiers/focusOn"; -import {Gravity} from "../../../../src/qualifiers/gravity"; -import {AutoFocus} from "../../../../src/qualifiers/autoFocus"; +import { FocusOn } from "../../../../src/qualifiers/focusOn"; +import { Gravity } from "../../../../src/qualifiers/gravity"; +import { AutoFocus } from "../../../../src/qualifiers/autoFocus"; -describe('FocusOn Gravity Qualifier', () => { - it('Expects focusOn to return {object}', () => { - expect(FocusOn.refrigerator().toString()).toBe('refrigerator'); - expect(FocusOn.sink().toString()).toBe('sink'); - expect(FocusOn.skateboard().toString()).toBe('skateboard'); - expect(FocusOn.person().toString()).toBe('person'); - expect(FocusOn.face().toString()).toBe('face'); - expect(FocusOn.horse().toString()).toBe('horse'); - expect(FocusOn.pottedplant().toString()).toBe('pottedplant'); - expect(FocusOn.sheep().toString()).toBe('sheep'); - expect(FocusOn.sofa().toString()).toBe('sofa'); - expect(FocusOn.train().toString()).toBe('train'); - expect(FocusOn.faces().toString()).toBe('faces'); - expect(FocusOn.advancedEyes().toString()).toBe('adv_eyes'); - expect(FocusOn.advancedFace().toString()).toBe('adv_face'); - expect(FocusOn.advancedFaces().toString()).toBe('adv_faces'); - expect(FocusOn.aeroplane().toString()).toBe('aeroplane'); - expect(FocusOn.background().toString()).toBe('background'); - expect(FocusOn.bicycle().toString()).toBe('bicycle'); - expect(FocusOn.bird().toString()).toBe('bird'); - expect(FocusOn.boat().toString()).toBe('boat'); - expect(FocusOn.bottle().toString()).toBe('bottle'); - expect(FocusOn.bus().toString()).toBe('bus'); - expect(FocusOn.car().toString()).toBe('car'); - expect(FocusOn.cat().toString()).toBe('cat'); - expect(FocusOn.chair().toString()).toBe('chair'); - expect(FocusOn.dog().toString()).toBe('dog'); - expect(FocusOn.cow().toString()).toBe('cow'); - expect(FocusOn.diningtable().toString()).toBe('diningtable'); - expect(FocusOn.tvmonitor().toString()).toBe('tvmonitor'); - expect(FocusOn.microwave().toString()).toBe('microwave'); - expect(FocusOn.motorbike().toString()).toBe('motorbike'); +describe("FocusOn Gravity Qualifier", () => { + it("Expects focusOn to return {object}", () => { + expect(FocusOn.refrigerator().toString()).toBe("refrigerator"); + expect(FocusOn.sink().toString()).toBe("sink"); + expect(FocusOn.skateboard().toString()).toBe("skateboard"); + expect(FocusOn.person().toString()).toBe("person"); + expect(FocusOn.face().toString()).toBe("face"); + expect(FocusOn.horse().toString()).toBe("horse"); + expect(FocusOn.pottedplant().toString()).toBe("pottedplant"); + expect(FocusOn.sheep().toString()).toBe("sheep"); + expect(FocusOn.sofa().toString()).toBe("sofa"); + expect(FocusOn.train().toString()).toBe("train"); + expect(FocusOn.faces().toString()).toBe("faces"); + expect(FocusOn.advancedEyes().toString()).toBe("adv_eyes"); + expect(FocusOn.advancedFace().toString()).toBe("adv_face"); + expect(FocusOn.advancedFaces().toString()).toBe("adv_faces"); + expect(FocusOn.aeroplane().toString()).toBe("aeroplane"); + expect(FocusOn.background().toString()).toBe("background"); + expect(FocusOn.bicycle().toString()).toBe("bicycle"); + expect(FocusOn.bird().toString()).toBe("bird"); + expect(FocusOn.boat().toString()).toBe("boat"); + expect(FocusOn.bottle().toString()).toBe("bottle"); + expect(FocusOn.bus().toString()).toBe("bus"); + expect(FocusOn.car().toString()).toBe("car"); + expect(FocusOn.cat().toString()).toBe("cat"); + expect(FocusOn.chair().toString()).toBe("chair"); + expect(FocusOn.dog().toString()).toBe("dog"); + expect(FocusOn.cow().toString()).toBe("cow"); + expect(FocusOn.diningtable().toString()).toBe("diningtable"); + expect(FocusOn.tvmonitor().toString()).toBe("tvmonitor"); + expect(FocusOn.microwave().toString()).toBe("microwave"); + expect(FocusOn.motorbike().toString()).toBe("motorbike"); }); - it('Expects Gravity.focusOn to return g_{object}', () => { - expect(Gravity.focusOn(FocusOn.cat()).toString()).toBe('g_cat'); - expect(Gravity.focusOn(FocusOn.person()).toString()).toBe('g_person'); + it("Expects Gravity.focusOn to return g_{object}", () => { + expect(Gravity.focusOn(FocusOn.cat()).toString()).toBe("g_cat"); + expect(Gravity.focusOn(FocusOn.person()).toString()).toBe("g_person"); }); - it('Expects multiple objects to return g_{obj}:{obj}', () => { - expect(Gravity.focusOn( - FocusOn.cat(), - FocusOn.dog(), - FocusOn.person() - ).toString()).toBe('g_cat:dog:person'); + it("Expects multiple objects to return g_{obj}:{obj}", () => { + expect(Gravity.focusOn(FocusOn.cat(), FocusOn.dog(), FocusOn.person()).toString()).toBe("g_cat:dog:person"); }); - it('Accepts a fallback AutoFocus gravity', () => { - const str = Gravity - .focusOn(FocusOn.cat(), FocusOn.dog()) + it("Accepts a fallback AutoFocus gravity", () => { + const str = Gravity.focusOn(FocusOn.cat(), FocusOn.dog()) .fallbackGravity( - Gravity.autoGravity() - .autoFocus( - AutoFocus.focusOn(FocusOn.microwave()).weight(30), - AutoFocus.focusOn(FocusOn.bicycle()).avoid() - ) + Gravity.autoGravity().autoFocus( + AutoFocus.focusOn(FocusOn.microwave()).weight(30), + AutoFocus.focusOn(FocusOn.bicycle()).avoid() + ) ) .toString(); - expect(str).toBe('g_cat:dog:auto:microwave_30:bicycle_avoid'); + expect(str).toBe("g_cat:dog:auto:microwave_30:bicycle_avoid"); }); }); diff --git a/__TESTS__/unit/values/gravity/Gravity.test.ts b/__TESTS__/unit/values/gravity/Gravity.test.ts index e951b8a..4dbf8fb 100644 --- a/__TESTS__/unit/values/gravity/Gravity.test.ts +++ b/__TESTS__/unit/values/gravity/Gravity.test.ts @@ -1,19 +1,15 @@ -import {Gravity} from "../../../../src/qualifiers/gravity"; -import {crop} from "../../../../src/actions/resize"; -import {Transformation} from "../../../../src"; +import { Gravity } from "../../../../src/qualifiers/gravity"; +import { crop } from "../../../../src/actions/resize"; +import { Transformation } from "../../../../src"; -describe('Gravity Qualifier', () => { - it ('Expects Gravity to include the four Gravity types', () => { +describe("Gravity Qualifier", () => { + it("Expects Gravity to include the four Gravity types", () => { expect(Gravity.autoGravity).toBeInstanceOf(Function); expect(Gravity.focusOn).toBeInstanceOf(Function); expect(Gravity.compass).toBeInstanceOf(Function); }); - it('Can use shortened gravity notation', ()=>{ - const tx = new Transformation() - .resize(crop() - .width(250) - .height(250) - .gravity('auto')).toString(); - expect(tx).toContain('c_crop,g_auto,h_250,w_250'); + it("Can use shortened gravity notation", () => { + const tx = new Transformation().resize(crop().width(250).height(250).gravity("auto")).toString(); + expect(tx).toContain("c_crop,g_auto,h_250,w_250"); }); }); diff --git a/__TESTS__/unit/values/valueImports.test.ts b/__TESTS__/unit/values/valueImports.test.ts index ef24fc4..82d0f99 100644 --- a/__TESTS__/unit/values/valueImports.test.ts +++ b/__TESTS__/unit/values/valueImports.test.ts @@ -1,91 +1,88 @@ -import {TextDecoration} from "../../../src/qualifiers/textDecoration"; -import {Dither} from "../../../src/qualifiers/dither"; -import {FontStyle} from "../../../src/qualifiers/fontStyle"; -import {StreamingProfile} from "../../../src/qualifiers/streamingProfile"; -import {ChromaSubSampling} from "../../../src/qualifiers/chromaSubSampling"; -import {ColorSpace} from "../../../src/qualifiers/colorSpace"; -import {AudioFrequency} from "../../../src/qualifiers/audioFrequency"; -import {OutlineMode} from "../../../src/qualifiers/outlineMode"; -import {FontWeight} from "../../../src/qualifiers/fontWeight"; -import {FontHinting} from "../../../src/qualifiers/fontHinting"; -import {TextAlignment} from "../../../src/qualifiers/textAlignment"; -import {ArtisticFilter} from "../../../src/qualifiers/artisticFilter"; -import {AudioCodec} from "../../../src/qualifiers/audioCodec"; -import {SimulateColorBlind} from "../../../src/qualifiers/simulateColorBlind"; -import {FontAntialias} from "../../../src/qualifiers/FontAntialias"; - -describe('Test imported qualifiers', () => { - it('Generates a URL', () => { - expect(ArtisticFilter.aurora()).toBe('aurora'); - expect(ArtisticFilter.audrey()).toBe('audrey'); - expect(ArtisticFilter.athena()).toBe('athena'); - expect(ArtisticFilter.alDente()).toBe('al_dente'); - expect(ArtisticFilter.peacock()).toBe('peacock'); - expect(ArtisticFilter.quartz()).toBe('quartz'); - expect(ArtisticFilter.primavera()).toBe('primavera'); - expect(ArtisticFilter.hokusai()).toBe('hokusai'); - expect(ArtisticFilter.hairspray()).toBe('hairspray'); - expect(ArtisticFilter.eucalyptus()).toBe('eucalyptus'); - expect(ArtisticFilter.daguerre()).toBe('daguerre'); - expect(ArtisticFilter.incognito()).toBe('incognito'); - expect(ArtisticFilter.redRock()).toBe('red_rock'); - expect(ArtisticFilter.fes()).toBe('fes'); - expect(ArtisticFilter.refresh()).toBe('refresh'); - expect(ArtisticFilter.sonnet()).toBe('sonnet'); - expect(ArtisticFilter.ukulele()).toBe('ukulele'); - expect(ArtisticFilter.zorro()).toBe('zorro'); - - - expect(OutlineMode.fill()).toBe('fill'); - expect(OutlineMode.innerFill()).toBe('inner_fill'); - expect(OutlineMode.inner()).toBe('inner'); - expect(OutlineMode.outer()).toBe('outer'); - - expect(FontStyle.italic()).toBe('italic'); - expect(FontStyle.normal()).toBe('normal'); - - expect(FontWeight.normal()).toBe('normal'); - expect(FontWeight.bold()).toBe('bold'); - expect(FontWeight.thin()).toBe('thin'); - expect(FontWeight.light()).toBe('light'); - - expect(FontHinting.none()).toBe(''); - expect(FontHinting.slight()).toBe('slight'); - expect(FontHinting.full()).toBe('full'); - expect(FontHinting.medium()).toBe('medium'); - - expect(FontAntialias.none()).toBe(''); - expect(FontAntialias.good()).toBe('good'); - expect(FontAntialias.best()).toBe('best'); - expect(FontAntialias.subpixel()).toBe('subpixel'); - expect(FontAntialias.gray()).toBe('gray'); - - expect(TextAlignment.left()).toBe('left'); - expect(TextAlignment.right()).toBe('right'); - expect(TextAlignment.center()).toBe('center'); - expect(TextAlignment.start()).toBe('start'); - expect(TextAlignment.end()).toBe('end'); - expect(TextAlignment.justify()).toBe('justify'); - - expect(TextDecoration.normal()).toBe(''); - expect(TextDecoration.strikethrough()).toBe('strikethrough'); - expect(TextDecoration.underline()).toBe('underline'); - - expect(ColorSpace.noCmyk()).toBe('no_cmyk'); - expect(ColorSpace.srgb()).toBe('srgb'); - expect(ColorSpace.trueColor()).toBe('srgb:truecolor'); - expect(ColorSpace.tinySrgb()).toBe('tinysrgb'); - expect(ColorSpace.keepCmyk()).toBe('keep_cmyk'); - expect(ColorSpace.cmyk()).toBe('cmyk'); - - - expect(StreamingProfile.fullHd()).toBe('full_hd'); - expect(StreamingProfile.hdLean()).toBe('hd_lean'); - expect(StreamingProfile.fullHdLean()).toBe('full_hd_lean'); - expect(StreamingProfile.fullHdWifi()).toBe('full_hd_wifi'); - expect(StreamingProfile.hd()).toBe('hd'); - expect(StreamingProfile.sd()).toBe('sd'); - +import { TextDecoration } from "../../../src/qualifiers/textDecoration"; +import { Dither } from "../../../src/qualifiers/dither"; +import { FontStyle } from "../../../src/qualifiers/fontStyle"; +import { StreamingProfile } from "../../../src/qualifiers/streamingProfile"; +import { ChromaSubSampling } from "../../../src/qualifiers/chromaSubSampling"; +import { ColorSpace } from "../../../src/qualifiers/colorSpace"; +import { AudioFrequency } from "../../../src/qualifiers/audioFrequency"; +import { OutlineMode } from "../../../src/qualifiers/outlineMode"; +import { FontWeight } from "../../../src/qualifiers/fontWeight"; +import { FontHinting } from "../../../src/qualifiers/fontHinting"; +import { TextAlignment } from "../../../src/qualifiers/textAlignment"; +import { ArtisticFilter } from "../../../src/qualifiers/artisticFilter"; +import { AudioCodec } from "../../../src/qualifiers/audioCodec"; +import { SimulateColorBlind } from "../../../src/qualifiers/simulateColorBlind"; +import { FontAntialias } from "../../../src/qualifiers/FontAntialias"; + +describe("Test imported qualifiers", () => { + it("Generates a URL", () => { + expect(ArtisticFilter.aurora()).toBe("aurora"); + expect(ArtisticFilter.audrey()).toBe("audrey"); + expect(ArtisticFilter.athena()).toBe("athena"); + expect(ArtisticFilter.alDente()).toBe("al_dente"); + expect(ArtisticFilter.peacock()).toBe("peacock"); + expect(ArtisticFilter.quartz()).toBe("quartz"); + expect(ArtisticFilter.primavera()).toBe("primavera"); + expect(ArtisticFilter.hokusai()).toBe("hokusai"); + expect(ArtisticFilter.hairspray()).toBe("hairspray"); + expect(ArtisticFilter.eucalyptus()).toBe("eucalyptus"); + expect(ArtisticFilter.daguerre()).toBe("daguerre"); + expect(ArtisticFilter.incognito()).toBe("incognito"); + expect(ArtisticFilter.redRock()).toBe("red_rock"); + expect(ArtisticFilter.fes()).toBe("fes"); + expect(ArtisticFilter.refresh()).toBe("refresh"); + expect(ArtisticFilter.sonnet()).toBe("sonnet"); + expect(ArtisticFilter.ukulele()).toBe("ukulele"); + expect(ArtisticFilter.zorro()).toBe("zorro"); + + expect(OutlineMode.fill()).toBe("fill"); + expect(OutlineMode.innerFill()).toBe("inner_fill"); + expect(OutlineMode.inner()).toBe("inner"); + expect(OutlineMode.outer()).toBe("outer"); + + expect(FontStyle.italic()).toBe("italic"); + expect(FontStyle.normal()).toBe("normal"); + + expect(FontWeight.normal()).toBe("normal"); + expect(FontWeight.bold()).toBe("bold"); + expect(FontWeight.thin()).toBe("thin"); + expect(FontWeight.light()).toBe("light"); + + expect(FontHinting.none()).toBe(""); + expect(FontHinting.slight()).toBe("slight"); + expect(FontHinting.full()).toBe("full"); + expect(FontHinting.medium()).toBe("medium"); + + expect(FontAntialias.none()).toBe(""); + expect(FontAntialias.good()).toBe("good"); + expect(FontAntialias.best()).toBe("best"); + expect(FontAntialias.subpixel()).toBe("subpixel"); + expect(FontAntialias.gray()).toBe("gray"); + + expect(TextAlignment.left()).toBe("left"); + expect(TextAlignment.right()).toBe("right"); + expect(TextAlignment.center()).toBe("center"); + expect(TextAlignment.start()).toBe("start"); + expect(TextAlignment.end()).toBe("end"); + expect(TextAlignment.justify()).toBe("justify"); + + expect(TextDecoration.normal()).toBe(""); + expect(TextDecoration.strikethrough()).toBe("strikethrough"); + expect(TextDecoration.underline()).toBe("underline"); + + expect(ColorSpace.noCmyk()).toBe("no_cmyk"); + expect(ColorSpace.srgb()).toBe("srgb"); + expect(ColorSpace.trueColor()).toBe("srgb:truecolor"); + expect(ColorSpace.tinySrgb()).toBe("tinysrgb"); + expect(ColorSpace.keepCmyk()).toBe("keep_cmyk"); + expect(ColorSpace.cmyk()).toBe("cmyk"); + + expect(StreamingProfile.fullHd()).toBe("full_hd"); + expect(StreamingProfile.hdLean()).toBe("hd_lean"); + expect(StreamingProfile.fullHdLean()).toBe("full_hd_lean"); + expect(StreamingProfile.fullHdWifi()).toBe("full_hd_wifi"); + expect(StreamingProfile.hd()).toBe("hd"); + expect(StreamingProfile.sd()).toBe("sd"); expect(Dither.threshold1x1Nondither()).toBe(0); expect(Dither.checkerboard2x1Dither()).toBe(1); @@ -108,23 +105,22 @@ describe('Test imported qualifiers', () => { expect(Dither.circles7x7Black()).toBe(17); expect(Dither.circles7x7White()).toBe(18); - expect(ChromaSubSampling.chroma420()).toBe(420); expect(ChromaSubSampling.chroma444()).toBe(444); - expect(SimulateColorBlind.coneMonochromacy()).toBe('cone_monochromacy'); - expect(SimulateColorBlind.deuteranomaly()).toBe('deuteranomaly'); - expect(SimulateColorBlind.deuteranopia()).toBe('deuteranopia'); - expect(SimulateColorBlind.protanopia()).toBe('protanopia'); - expect(SimulateColorBlind.rodMonochromacy()).toBe('rod_monochromacy'); - expect(SimulateColorBlind.tritanomaly()).toBe('tritanomaly'); - expect(SimulateColorBlind.tritanopia()).toBe('tritanopia'); + expect(SimulateColorBlind.coneMonochromacy()).toBe("cone_monochromacy"); + expect(SimulateColorBlind.deuteranomaly()).toBe("deuteranomaly"); + expect(SimulateColorBlind.deuteranopia()).toBe("deuteranopia"); + expect(SimulateColorBlind.protanopia()).toBe("protanopia"); + expect(SimulateColorBlind.rodMonochromacy()).toBe("rod_monochromacy"); + expect(SimulateColorBlind.tritanomaly()).toBe("tritanomaly"); + expect(SimulateColorBlind.tritanopia()).toBe("tritanopia"); - expect(AudioCodec.aac()).toBe('aac'); - expect(AudioCodec.mp3()).toBe('mp3'); - expect(AudioCodec.opus()).toBe('opus'); - expect(AudioCodec.none()).toBe('none'); - expect(AudioCodec.vorbis()).toBe('vorbis'); + expect(AudioCodec.aac()).toBe("aac"); + expect(AudioCodec.mp3()).toBe("mp3"); + expect(AudioCodec.opus()).toBe("opus"); + expect(AudioCodec.none()).toBe("none"); + expect(AudioCodec.vorbis()).toBe("vorbis"); expect(AudioFrequency.FREQ11025()).toBe(11025); expect(AudioFrequency.FREQ8000()).toBe(8000); @@ -140,6 +136,6 @@ describe('Test imported qualifiers', () => { expect(AudioFrequency.FREQ96000()).toBe(96000); expect(AudioFrequency.FREQ176400()).toBe(176400); expect(AudioFrequency.FREQ192000()).toBe(192000); - expect(AudioFrequency.ORIGINAL()).toBe('iaf'); + expect(AudioFrequency.ORIGINAL()).toBe("iaf"); }); }); diff --git a/bundlewatch.config.js b/bundlewatch.config.js index eb54c09..0094f2a 100644 --- a/bundlewatch.config.js +++ b/bundlewatch.config.js @@ -1,11 +1,11 @@ const bundlewatchConfig = { files: [ { - path: './dist/bundles/umd/base.js', - maxSize: '10kb' - } + path: "./dist/bundles/umd/base.js", + maxSize: "10kb", + }, ], - defaultCompression: 'gzip', + defaultCompression: "gzip", }; module.exports = bundlewatchConfig; diff --git a/devTools/sanity/createTestFile.ts b/devTools/sanity/createTestFile.ts index 4928a6f..8881732 100644 --- a/devTools/sanity/createTestFile.ts +++ b/devTools/sanity/createTestFile.ts @@ -1,11 +1,10 @@ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable require-jsdoc */ +import { IFrameworkResponse } from "sdk-sanity-generator/dist/interfaces"; +const prettier = require("prettier"); -import {IFrameworkResponse} from "sdk-sanity-generator/dist/interfaces"; -const prettier = require('prettier'); - -function createTestFile(txs: IFrameworkResponse[]){ +function createTestFile(txs: IFrameworkResponse[]) { let file = ` // In the future, we'll support HOTER tests without name duplication issues, for now it's commented out // It's stored here since this is built manually, and it's best to keep the work :) @@ -156,48 +155,52 @@ import {CloudinaryImage, CloudinaryVideo, } from "@cloduinary-url-gen"; file += `describe("Testing", () => {\n`; - file += txs.map((txResult) => { - let test = `it("${txResult.transformation}", () => {`; - // If the SDK does not support the transformation, we comment out the test - - if (txResult.status === 11) { - test += txResult.status === 11 ? '/* SUCCESS, BUT NO GENERATED CODE - THE SDK DOES NOT SUPPORT THIS TRANSFORMATION' : ''; - } - - if (txResult.status !== 11) { - test += `const tAsset = ${txResult.codeSnippet}`; + file += txs + .map((txResult) => { + let test = `it("${txResult.transformation}", () => {`; + // If the SDK does not support the transformation, we comment out the test - if (txResult.transformation.startsWith('http')) { + if (txResult.status === 11) { + test += + txResult.status === 11 + ? "/* SUCCESS, BUT NO GENERATED CODE - THE SDK DOES NOT SUPPORT THIS TRANSFORMATION" + : ""; + } - // For URLS, If not a demo cloud, we do not support the compilation test. - if (!txResult.transformation.includes('/demo/')) { - throw `Unsupported URL: ${txResult.transformation}`; + if (txResult.status !== 11) { + test += `const tAsset = ${txResult.codeSnippet}`; + + if (txResult.transformation.startsWith("http")) { + // For URLS, If not a demo cloud, we do not support the compilation test. + if (!txResult.transformation.includes("/demo/")) { + throw `Unsupported URL: ${txResult.transformation}`; + } + + test += `tAsset.setCloudConfig({cloudName: 'demo'});`; + test += `tAsset.setURLConfig({analytics:false});`; + test += `expect(tAsset.toString()).toBe('${txResult.transformation}');`; + } else { + test += `const parts = '${txResult.transformation}'.replace(/\\//g, ',').split(',');\n\n`; + test += `parts.forEach((part) => { expect(tAsset.toString()).toContain(part)})`; } - - test += `tAsset.setCloudConfig({cloudName: 'demo'});`; - test += `tAsset.setURLConfig({analytics:false});`; - test += `expect(tAsset.toString()).toBe('${txResult.transformation}');`; - } else { - test += `const parts = '${txResult.transformation}'.replace(/\\//g, ',').split(',');\n\n`; - test += `parts.forEach((part) => { expect(tAsset.toString()).toContain(part)})`; } - } - // If the SDK does not support the transformation, we close the comment that was opened above - test += txResult.status === 11 ? '*/' : ''; - test += '\n})\n'; // Close it test + // If the SDK does not support the transformation, we close the comment that was opened above + test += txResult.status === 11 ? "*/" : ""; + test += "\n})\n"; // Close it test - try { - return prettier.format(test, {parser:'babel'}); - } catch (e) { - return test; - } - }).join('\n'); + try { + return prettier.format(test, { parser: "babel" }); + } catch (e) { + return test; + } + }) + .join("\n"); file += `\n})\n`; try { - return prettier.format(file, {parser:'babel'}); + return prettier.format(file, { parser: "babel" }); } catch (e) { return file; } diff --git a/devTools/sanity/index.ts b/devTools/sanity/index.ts index 664c9d6..03c17df 100644 --- a/devTools/sanity/index.ts +++ b/devTools/sanity/index.ts @@ -1,15 +1,15 @@ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable require-jsdoc */ -import {ISanityGeneratorResponse} from "sdk-sanity-generator"; +import { ISanityGeneratorResponse } from "sdk-sanity-generator"; -const fs = require('fs'); -const sanityGenerator = require('sdk-sanity-generator').sanityGenerator; -const createTestFile = require('./createTestFile'); +const fs = require("fs"); +const sanityGenerator = require("sdk-sanity-generator").sanityGenerator; +const createTestFile = require("./createTestFile"); sanityGenerator({ - framework: 'js_2', - requestSpreading: 70 + framework: "js_2", + requestSpreading: 70, }).then((res: ISanityGeneratorResponse) => { console.log(res); console.log(`Successful transformations: ${res.success.length}`); diff --git a/jest.config.json b/jest.config.json index 6a7d716..4239c41 100644 --- a/jest.config.json +++ b/jest.config.json @@ -11,9 +11,7 @@ "!/scripts/copyPackageJsonToSrc.ts.ts", "!/src/backwards/**/*.ts" ], - "modulePaths": [ - "/src" - ], + "modulePaths": ["/src"], "coverageThreshold": { "global": { "branches": 40, @@ -27,13 +25,16 @@ "diagnostics": false } }, - "reporters": [ + "reporters": [ "default", - ["jest-html-reporters", { - "publicPath" : "./public/progress/", - "filename": "cloudinary-base-progress-report.html", - "pageTitle": "Cloudinary JS v2 Progress Report", - "expand": true - }] + [ + "jest-html-reporters", + { + "publicPath": "./public/progress/", + "filename": "cloudinary-base-progress-report.html", + "pageTitle": "Cloudinary JS v2 Progress Report", + "expand": true + } + ] ] } diff --git a/jsdoc.config.json b/jsdoc.config.json index 92c1376..8a4c6cf 100644 --- a/jsdoc.config.json +++ b/jsdoc.config.json @@ -1,32 +1,37 @@ { "tags": { "allowUnknownTags": true, - "dictionaries": ["jsdoc","closure"] + "dictionaries": ["jsdoc", "closure"] }, "source": { "include": ["src"], "includePattern": ".+\\.ts(doc|x)?$" }, - "plugins": [ - "plugins/markdown", - "node_modules/better-docs/typescript" - ], + "plugins": ["plugins/markdown", "node_modules/better-docs/typescript"], "typescript": { "moduleRoot": "src" }, "templates": { "cleverLinks": true, - "navMembers" : [ - {"kind": "namespace", "title": "Actions & Qualifiers", "summary": "All documented namespaces."}, - {"kind": "interface", "title": "Interfaces", "summary": "All documented interfaces."}, - {"kind": "tutorial", "title": "Help & Examples", "summary": "All available tutorials."} - ], - "stylesheets" : [ - "./customStyles.css" - ], - "scripts" : [ - "./injectVersionSemver.js" + "navMembers": [ + { + "kind": "namespace", + "title": "Actions & Qualifiers", + "summary": "All documented namespaces." + }, + { + "kind": "interface", + "title": "Interfaces", + "summary": "All documented interfaces." + }, + { + "kind": "tutorial", + "title": "Help & Examples", + "summary": "All available tutorials." + } ], + "stylesheets": ["./customStyles.css"], + "scripts": ["./injectVersionSemver.js"], "search": true, "monospaceLinks": true, "systemColor": "#3448C5", diff --git a/package.json b/package.json index b5d0bef..b496007 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "start": "rollup -c rollup.dev.config.js -w", "bundlewatch": "bundlewatch --config ./bundlewatch.config.js", "release-dry-run": "npm run build && cp README.md LICENSE ./dist && cd ./dist && release-it --dry-run", - "release": "npm run build && cp README.md LICENSE ./dist && cd ./dist && release-it" + "release": "npm run build && cp README.md LICENSE ./dist && cd ./dist && release-it", + "prepare": "husky install" }, "keywords": [], "author": "", @@ -41,11 +42,12 @@ "@rollup/plugin-node-resolve": "^7.1.1", "@rollup/plugin-replace": "^3.0.0", "@rollup/plugin-typescript": "^8.2.5", + "@types/babel__traverse": "7.0.6", "@types/jest": "^25.2.3", "@types/mock-fs": "^4.10.0", "@types/node": "^15.14.2", - "@types/webpack": "^4.41.21", "@types/prettier": "2.6.0", + "@types/webpack": "^4.41.21", "@typescript-eslint/eslint-plugin": "^3.0.2", "@typescript-eslint/parser": "^3.0.2", "better-docs": "2.3.2", @@ -67,11 +69,13 @@ "grunt-jsdoc": "2.4.1", "handlebars": "^4.0.11", "handlebars-layouts": "^3.1.4", + "husky": "^8.0.3", "jest": "^26.0.1", "jest-html-reporters": "^1.2.1", "jquery": "3.1.1", "jsdoc": "3.6.4", "jsdoc-plugin-typescript": "2.0.5", + "lint-staged": "^13.2.3", "lunr": "^1.0.0", "mock-fs": "^4.12.0", "moment": "^2.22.1", @@ -89,8 +93,7 @@ "tslib": "^2.0.0", "typedoc": "^0.17.8", "typescript": "3.9.10", - "webpack": "^4.44.1", - "@types/babel__traverse": "7.0.6" + "webpack": "^4.44.1" }, "exports": { "./bundles/umd/package.json": "./bundles/umd/package.json", @@ -136,5 +139,8 @@ }, "dependencies": { "@cloudinary/url-gen": "^1.7.0" + }, + "lint-staged": { + "**/*": "prettier --write --ignore-unknown" } -} \ No newline at end of file +} diff --git a/rollup.config.js b/rollup.config.js index 4bcc5d5..e9b2356 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,50 +1,49 @@ -import resolve from '@rollup/plugin-node-resolve'; -import typescript from '@rollup/plugin-typescript'; -import json from '@rollup/plugin-json'; -import commonjs from '@rollup/plugin-commonjs'; -import replace from '@rollup/plugin-replace'; -import multi from 'rollup-plugin-multi-input'; -import {version} from './package.json'; +import resolve from "@rollup/plugin-node-resolve"; +import typescript from "@rollup/plugin-typescript"; +import json from "@rollup/plugin-json"; +import commonjs from "@rollup/plugin-commonjs"; +import replace from "@rollup/plugin-replace"; +import multi from "rollup-plugin-multi-input"; +import { version } from "./package.json"; export default [ { - input: 'src/index.ts', + input: "src/index.ts", output: [ { - file: 'dist/bundles/umd/base.js', - format: 'umd', - name: 'CldUrlGen', + file: "dist/bundles/umd/base.js", + format: "umd", + name: "CldUrlGen", }, ], plugins: [ json(), resolve(), replace({ - 'PACKAGE_VERSION_INJECTED_DURING_BUILD': version, + PACKAGE_VERSION_INJECTED_DURING_BUILD: version, }), - typescript({ target: 'es5' }), + typescript({ target: "es5" }), commonjs(), ], }, { - input: 'src/**/*.ts', + input: "src/**/*.ts", output: { - format: 'cjs', - dir: 'dist', - entryFileNames: '[name].cjs', - chunkFileNames: '[name]-[hash].cjs', - exports: 'auto', + format: "cjs", + dir: "dist", + entryFileNames: "[name].cjs", + chunkFileNames: "[name]-[hash].cjs", + exports: "auto", }, plugins: [ multi(), json(), resolve(), replace({ - 'PACKAGE_VERSION_INJECTED_DURING_BUILD': version, + PACKAGE_VERSION_INJECTED_DURING_BUILD: version, }), typescript({ target: "es5" }), - commonjs() - ] - } + commonjs(), + ], + }, ]; - diff --git a/rollup.dev.config.js b/rollup.dev.config.js index ba0104d..5db676e 100644 --- a/rollup.dev.config.js +++ b/rollup.dev.config.js @@ -1,31 +1,31 @@ -import resolve from '@rollup/plugin-node-resolve'; -import babel from '@rollup/plugin-babel'; -import serve from 'rollup-plugin-serve'; +import resolve from "@rollup/plugin-node-resolve"; +import babel from "@rollup/plugin-babel"; +import serve from "rollup-plugin-serve"; import typescript from "@rollup/plugin-typescript"; -import json from '@rollup/plugin-json'; -import replace from '@rollup/plugin-replace'; -import {version} from './package.json'; +import json from "@rollup/plugin-json"; +import replace from "@rollup/plugin-replace"; +import { version } from "./package.json"; export default { - input: 'src/index.ts', + input: "src/index.ts", output: [ { - file: 'playground/base.esm.js', - format: 'esm' - } + file: "playground/base.esm.js", + format: "esm", + }, ], plugins: [ json(), typescript(), serve({ - contentBase: 'playground' + contentBase: "playground", }), resolve(), replace({ - 'PACKAGE_VERSION_INJECTED_DURING_BUILD': version + PACKAGE_VERSION_INJECTED_DURING_BUILD: version, }), babel({ - exclude: 'node_modules/**' // only transpile our source code - }) - ] + exclude: "node_modules/**", // only transpile our source code + }), + ], }; diff --git a/scripts/createEntrypoints.ts b/scripts/createEntrypoints.ts index 1d108ec..1f0b87b 100644 --- a/scripts/createEntrypoints.ts +++ b/scripts/createEntrypoints.ts @@ -10,11 +10,7 @@ * (@base/actions/adjust points to @base/bundles/esm/actions/adjust) */ -const { - copyPackageJson, - createUMDBundleEntryPoint -} = require('./lib/entryPointsLib'); - +const { copyPackageJson, createUMDBundleEntryPoint } = require("./lib/entryPointsLib"); // Allows import from '@base' (With types) copyPackageJson(); diff --git a/scripts/errors/FoundNonRequiredFile.ts b/scripts/errors/FoundNonRequiredFile.ts index 980d7b7..5378bee 100644 --- a/scripts/errors/FoundNonRequiredFile.ts +++ b/scripts/errors/FoundNonRequiredFile.ts @@ -1,5 +1,5 @@ class FoundNonRequiredFile extends Error { - constructor(filePath:string) { + constructor(filePath: string) { super(); this.message = `File not required by Tree but exists in file system: ${filePath}`; this.name = "FoundNonRequiredFile"; diff --git a/scripts/errors/MissingRequiredFile.ts b/scripts/errors/MissingRequiredFile.ts index 1b0f4f6..b3d9ca4 100644 --- a/scripts/errors/MissingRequiredFile.ts +++ b/scripts/errors/MissingRequiredFile.ts @@ -1,5 +1,5 @@ class MissingRequiredFile extends Error { - constructor(currentPath:string) { + constructor(currentPath: string) { super(); this.message = `File ${currentPath} does not exist, \nIf you added a new file or folder, please update the validation step`; this.name = "MissingRequiredFileError"; diff --git a/scripts/injectPackageVersionToDistFiles.ts b/scripts/injectPackageVersionToDistFiles.ts index 128e299..5522c86 100644 --- a/scripts/injectPackageVersionToDistFiles.ts +++ b/scripts/injectPackageVersionToDistFiles.ts @@ -3,15 +3,15 @@ /** * This script goes over dist files and replaces the package version placeholder to be the actual package version. */ -const replace = require('replace-in-file'); -const {version} = require('../package.json'); -const {resolve} = require('path'); +const replace = require("replace-in-file"); +const { version } = require("../package.json"); +const { resolve } = require("path"); -const distFolder = resolve('./dist'); +const distFolder = resolve("./dist"); const options = { files: [`${distFolder}/**/*.js`, `${distFolder}/**/*.cjs`, `${distFolder}/**/*.ts`], from: /PACKAGE_VERSION_INJECTED_DURING_BUILD/g, - to: version + to: version, }; // Internationally not catching errors so that build will fail on error @@ -22,7 +22,7 @@ const fileNamesReplaced = replace // files is not empty if (fileNamesReplaced.length) { - console.log('Successfully injected package version to dist files:', fileNamesReplaced); + console.log("Successfully injected package version to dist files:", fileNamesReplaced); } else { - throw 'Failed to inject package version to dist files because no matching files where found'; + throw "Failed to inject package version to dist files because no matching files where found"; } diff --git a/scripts/lib/entryPointsLib.ts b/scripts/lib/entryPointsLib.ts index 21b6ad9..a6c2d1a 100644 --- a/scripts/lib/entryPointsLib.ts +++ b/scripts/lib/entryPointsLib.ts @@ -3,11 +3,11 @@ * This file contains utility functions related to creating ./dist entry-points (such as @base/actions/adjust) */ -const fs = require('fs'); +const fs = require("fs"); // All of our package.jsons need to contain this property to allow tree shaking const commonPackageProperties = { - sideEffects: false + sideEffects: false, }; /** @@ -15,40 +15,34 @@ const commonPackageProperties = { * Allows users to import from '@base/bundles/umd' */ function createUMDBundleEntryPoint() { - const packageJson = Object.assign({ - "types": `../../index.d.ts`, - "main": `./base.js` - }, commonPackageProperties); + const packageJson = Object.assign( + { + types: `../../index.d.ts`, + main: `./base.js`, + }, + commonPackageProperties + ); // create umd - fs.writeFileSync( - `dist/bundles/umd/package.json`, - JSON.stringify(packageJson, null, '\t') - ); + fs.writeFileSync(`dist/bundles/umd/package.json`, JSON.stringify(packageJson, null, "\t")); } - /** * @description Since only ./dist/ is packaged to npm, we need to copy a proper package.json file to it * That will allow `import {TransformableImage} from '@cloudinary/url-gen` */ -function copyPackageJson(fileDestination = 'dist') { - const projectJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); +function copyPackageJson(fileDestination = "dist") { + const projectJson = JSON.parse(fs.readFileSync("./package.json", "utf-8")); delete projectJson.scripts; delete projectJson.devDependencies; - projectJson.main = './bundles/umd/base.js'; - projectJson.browser = './index.js'; - projectJson.module = './index.js'; - projectJson.type = 'module', - - Object.assign(projectJson, commonPackageProperties); - fs.writeFileSync(`./${fileDestination}/package.json`, JSON.stringify(projectJson, null, '\t')); + projectJson.main = "./bundles/umd/base.js"; + projectJson.browser = "./index.js"; + projectJson.module = "./index.js"; + (projectJson.type = "module"), Object.assign(projectJson, commonPackageProperties); + fs.writeFileSync(`./${fileDestination}/package.json`, JSON.stringify(projectJson, null, "\t")); } - module.exports = { copyPackageJson, - createUMDBundleEntryPoint + createUMDBundleEntryPoint, }; - - diff --git a/scripts/updateCompliationTests.js b/scripts/updateCompliationTests.js index 010113f..d5eacc6 100644 --- a/scripts/updateCompliationTests.js +++ b/scripts/updateCompliationTests.js @@ -8,20 +8,20 @@ * 4. npm run test will run this script first, it will not update if the env variables are not set */ const CODE_GENERATOR_PATH = process.argv[3] || process.env.CODE_GENERATOR_PATH; -const COMPILATION_TESTS_LOCAL_PATH = './__TESTS__/compilation.test.ts'; -const CYAN_COLOR = '\x1b[36m%s\x1b[0m'; +const COMPILATION_TESTS_LOCAL_PATH = "./__TESTS__/compilation.test.ts"; +const CYAN_COLOR = "\x1b[36m%s\x1b[0m"; if (!CODE_GENERATOR_PATH) { - console.log('SKIP - Cannot update compilation tests - do you have an env variable set?'); + console.log("SKIP - Cannot update compilation tests - do you have an env variable set?"); process.exit(0); // nothing to do, lets skip } -const ENV_RUBY_VER = process.argv[4] || process.env.ENV_RUBY_VER || '2.7.1'; -const { execSync } = require('child_process'); -const fs = require('fs'); +const ENV_RUBY_VER = process.argv[4] || process.env.ENV_RUBY_VER || "2.7.1"; +const { execSync } = require("child_process"); +const fs = require("fs"); // Enable passing a key to the code generator. // This enables us to create compiation tests based on a specific qualifier (like `a_` or `c_`) -const addKeyEnvVar = process.env.KEY ? `KEY=${process.env.KEY}` : '' +const addKeyEnvVar = process.env.KEY ? `KEY=${process.env.KEY}` : ""; const bashScript = ` cd ${CODE_GENERATOR_PATH}; # NOTE - We pipe the response of rspec to prevent the script from exiting in case the rspec command fails @@ -39,7 +39,7 @@ if (!fs.existsSync(TEST_FILE_PATH)) { throw `Error copying compilation tests, ${TEST_FILE_PATH} does not exist`; } -const file = fs.readFileSync(TEST_FILE_PATH, 'utf-8'); +const file = fs.readFileSync(TEST_FILE_PATH, "utf-8"); // Delete existing file if (fs.existsSync(COMPILATION_TESTS_LOCAL_PATH)) { @@ -50,24 +50,22 @@ if (fs.existsSync(COMPILATION_TESTS_LOCAL_PATH)) { fs.writeFileSync(COMPILATION_TESTS_LOCAL_PATH, file); // delete temporary script -fs.unlinkSync('./scripts/tmp.sh'); - +fs.unlinkSync("./scripts/tmp.sh"); // If this entire process was successful, lets add some proper logs if (fs.existsSync(COMPILATION_TESTS_LOCAL_PATH)) { // Reset terminal, clean junk - process.stdout.write('\033c'); + process.stdout.write("\033c"); // Add some buffer - console.log('\n\n'); + console.log("\n\n"); - console.log(CYAN_COLOR, '* Compilation tests generated successfully'); + console.log(CYAN_COLOR, "* Compilation tests generated successfully"); if (process.env.KEY) { - console.log(CYAN_COLOR, `* Compilation test contains only "${process.env.KEY}_" qualifier`) + console.log(CYAN_COLOR, `* Compilation test contains only "${process.env.KEY}_" qualifier`); } else { - console.log(CYAN_COLOR, `* Compilation test contains all qualifiers`) + console.log(CYAN_COLOR, `* Compilation test contains all qualifiers`); } // Add some buffer - console.log('\n\n'); + console.log("\n\n"); } - diff --git a/scripts/updateInjectVersionSemver.js b/scripts/updateInjectVersionSemver.js index f2bae48..4a8f37b 100644 --- a/scripts/updateInjectVersionSemver.js +++ b/scripts/updateInjectVersionSemver.js @@ -3,8 +3,8 @@ * This script updates the file __DOCS__/resources/injectVersionSemver.js. * It needs to run on every docs generation so that we have an updated package version in docs. */ -const fs = require('fs'); -const pkg = require('../package.json'); +const fs = require("fs"); +const pkg = require("../package.json"); // Inject the package json version to the Docs reference footer and navbar const data = ` @@ -14,4 +14,4 @@ $('.branding-logo').html(content + ' - ${pkg.version}'); $('.copyright').html('Copyright © ' + new Date().getFullYear() + ' Cloudinary.com'); `; -fs.writeFileSync('__DOCS__/resources/injectVersionSemver.js', data); +fs.writeFileSync("__DOCS__/resources/injectVersionSemver.js", data); diff --git a/scripts/updatePackageJsonExports.ts b/scripts/updatePackageJsonExports.ts index e317e1e..a7fd46e 100644 --- a/scripts/updatePackageJsonExports.ts +++ b/scripts/updatePackageJsonExports.ts @@ -5,11 +5,11 @@ */ // eslint-disable-next-line @typescript-eslint/no-var-requires -const {resolve} = require('path'); +const { resolve } = require("path"); // eslint-disable-next-line @typescript-eslint/no-var-requires -const {writeFile, readdirSync} = require('fs'); +const { writeFile, readdirSync } = require("fs"); // eslint-disable-next-line @typescript-eslint/no-var-requires -const packageJson = require('../package.json'); +const packageJson = require("../package.json"); interface Dirent { isDirectory: () => boolean; @@ -17,21 +17,20 @@ interface Dirent { } // List of sub-directories under ./dist -const distSubDirectoriesArray: string[] = readdirSync(resolve('./dist'), {withFileTypes: true}) +const distSubDirectoriesArray: string[] = readdirSync(resolve("./dist"), { + withFileTypes: true, +}) // Filter out files .filter((dirent: Dirent) => dirent.isDirectory()) // Get directory name .map((dirent: Dirent) => `./${dirent.name}`) // Exclude /internal - .filter((dir: string) => !dir.toLowerCase().includes('/internal')) + .filter((dir: string) => !dir.toLowerCase().includes("/internal")) // Sort alphabetically .sort(); // Convert directory string to object of {[./directory/*]: { require: "directory/*.mjs", import: "directory/*.js" }} -const distSubDirectoriesObj: Record< - string, - Record -> = distSubDirectoriesArray.reduce( +const distSubDirectoriesObj: Record> = distSubDirectoriesArray.reduce( (obj, dir) => ({ ...obj, ...{ [`${dir}/*`]: { require: `${dir}/*.cjs`, import: `${dir}/*.js` } }, @@ -40,33 +39,37 @@ const distSubDirectoriesObj: Record< ); // Generate updated package json object -const resultPackageJson = JSON.stringify({ - ...packageJson, - exports: { - "./bundles/umd/package.json": "./bundles/umd/package.json", - "./bundles/umd": { - "require": "./bundles/umd/base.js", - "import": "./bundles/umd/base.js" +const resultPackageJson = JSON.stringify( + { + ...packageJson, + exports: { + "./bundles/umd/package.json": "./bundles/umd/package.json", + "./bundles/umd": { + require: "./bundles/umd/base.js", + import: "./bundles/umd/base.js", + }, + "./package.json": "./package.json", + ...distSubDirectoriesObj, + "./*": { + require: "./*.cjs", + import: "./*.js", + }, + ".": { + require: "./index.cjs", + import: "./index.js", + node: "./index.js", + default: "./index.js", + }, }, - "./package.json": "./package.json", - ...distSubDirectoriesObj, - "./*": { - "require": "./*.cjs", - "import": "./*.js" - }, - ".": { - "require": "./index.cjs", - "import": "./index.js", - "node": "./index.js", - "default": "./index.js" - } - } -}, null, 2); + }, + null, + 2 +); // Update (overwrite) package.json -writeFile(resolve('./package.json'), resultPackageJson, (err: Error) => { +writeFile(resolve("./package.json"), resultPackageJson, (err: Error) => { if (!err) { - console.log('Successfully updated package.json exports field'); + console.log("Successfully updated package.json exports field"); } else { throw `Failed to updated package.json exports field: ${err}`; } diff --git a/scripts/validatePackageFiles.ts b/scripts/validatePackageFiles.ts index 0023c86..8dbf523 100644 --- a/scripts/validatePackageFiles.ts +++ b/scripts/validatePackageFiles.ts @@ -1,12 +1,12 @@ /* eslint-disable @typescript-eslint/no-var-requires */ // Since interfaces are not real objects, we can't use require, but instead we use import -import {IFileStructureLevel, IFlatFileStructureLevel} from "./lib/interfaces/IFileStructure"; +import { IFileStructureLevel, IFlatFileStructureLevel } from "./lib/interfaces/IFileStructure"; -const fs = require('fs'); -const path = require('path'); -const MissingRequiredFile = require('./errors/MissingRequiredFile'); -const FoundNonRequiredFile = require('./errors/FoundNonRequiredFile'); +const fs = require("fs"); +const path = require("path"); +const MissingRequiredFile = require("./errors/MissingRequiredFile"); +const FoundNonRequiredFile = require("./errors/FoundNonRequiredFile"); /** * @@ -21,7 +21,7 @@ function ensureNoUnwantedFiles(tree: IFlatFileStructureLevel, currentPath: strin const filesInCurrentFolder = fs.readdirSync(currentPath); // Loop over the real files - filesInCurrentFolder.forEach((fileInCurrentFolder:string) => { + filesInCurrentFolder.forEach((fileInCurrentFolder: string) => { // If tree[fileName] is set to false, we skip to the next file const ignoreFile = tree[fileInCurrentFolder] === false; if (ignoreFile) { @@ -29,7 +29,7 @@ function ensureNoUnwantedFiles(tree: IFlatFileStructureLevel, currentPath: strin } // If the file does not exist in the tree - const fileNotSpecified = typeof tree[fileInCurrentFolder] === 'undefined'; + const fileNotSpecified = typeof tree[fileInCurrentFolder] === "undefined"; // We found a file that exists in the file system but not specified in the Tree if (fileNotSpecified) { @@ -44,7 +44,7 @@ function ensureNoUnwantedFiles(tree: IFlatFileStructureLevel, currentPath: strin */ function isFileStructure(obj: any): obj is IFileStructureLevel { // Typeof object is good enough - return typeof obj === 'object'; + return typeof obj === "object"; } /** @@ -70,13 +70,10 @@ function isFileStructure(obj: any): obj is IFileStructureLevel { * @param treeWithFlags * @param currentPath */ -function validatePackageFiles(treeWithFlags: IFileStructureLevel, currentPath = './dist') { +function validatePackageFiles(treeWithFlags: IFileStructureLevel, currentPath = "./dist") { // Our input represents a file structure level that might have flags. // We need to extract flags that might exist in this level - const { - $suppressNonRequiredFilesError, - ...tree - } = treeWithFlags; + const { $suppressNonRequiredFilesError, ...tree } = treeWithFlags; // Ensure no unwanted files exist in the current directory level if (!$suppressNonRequiredFilesError) { @@ -84,16 +81,16 @@ function validatePackageFiles(treeWithFlags: IFileStructureLevel, currentPath = } // Ensure all tree files exist in the file system - Object.keys(tree).forEach((fileSymbol:keyof typeof tree) => { + Object.keys(tree).forEach((fileSymbol: keyof typeof tree) => { const fullFileSystemPath = path.join(currentPath, fileSymbol); const requiredFileInTree = tree[fileSymbol]; // The required file can be either a string, or nested object. // If string, we can validate immediately - if (typeof requiredFileInTree === 'string') { - const existsInFileSystem = fs.existsSync(fullFileSystemPath, 'utf-8'); + if (typeof requiredFileInTree === "string") { + const existsInFileSystem = fs.existsSync(fullFileSystemPath, "utf-8"); - if(!existsInFileSystem) { + if (!existsInFileSystem) { throw new MissingRequiredFile(fullFileSystemPath); } } diff --git a/src/actions.ts b/src/actions.ts index 22d31e2..bba2b90 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -1,15 +1,15 @@ -export {Resize} from "./actions/resize.js"; -export {Border} from "./actions/border.js"; -export {RoundCorners} from "./actions/roundCorners.js"; -export {Effect} from "./actions/effect.js"; -export {Rotate} from "./actions/rotate.js"; -export {Adjust} from "./actions/adjust.js"; -export {Overlay} from "./actions/overlay.js"; -export {Underlay} from "./actions/underlay.js"; -export {NamedTransformation} from "./actions/namedTransformation.js"; -export {Delivery} from "./actions/delivery.js"; -export {CustomFunction} from "./actions/customFunction.js"; -export {VideoEdit} from "./actions/videoEdit.js"; -export {Transcode} from "./actions/transcode.js"; -export {PSDTools} from "./actions/psdTools.js"; -export {Animated} from "./actions/animated.js"; +export { Resize } from "./actions/resize.js"; +export { Border } from "./actions/border.js"; +export { RoundCorners } from "./actions/roundCorners.js"; +export { Effect } from "./actions/effect.js"; +export { Rotate } from "./actions/rotate.js"; +export { Adjust } from "./actions/adjust.js"; +export { Overlay } from "./actions/overlay.js"; +export { Underlay } from "./actions/underlay.js"; +export { NamedTransformation } from "./actions/namedTransformation.js"; +export { Delivery } from "./actions/delivery.js"; +export { CustomFunction } from "./actions/customFunction.js"; +export { VideoEdit } from "./actions/videoEdit.js"; +export { Transcode } from "./actions/transcode.js"; +export { PSDTools } from "./actions/psdTools.js"; +export { Animated } from "./actions/animated.js"; diff --git a/src/actions/adjust.ts b/src/actions/adjust.ts index d4326b7..8365d4d 100644 --- a/src/actions/adjust.ts +++ b/src/actions/adjust.ts @@ -1,15 +1,15 @@ -import {FillLightAction} from "./adjust/FillLightAction.js"; -import {RecolorAction} from "./adjust/RecolorAction.js"; -import {OpacityAdjustAction} from "./adjust/OpacityAdjustAction.js"; -import {By3dLutAction} from "./adjust/By3dLutAction.js"; -import {ImproveAction} from "./adjust/ImproveAction.js"; -import {ReplaceColorAction} from "./adjust/ReplaceColorAction.js"; -import {EffectActionWithLevel} from "./effect/EffectActions/EffectActionWithLevel.js"; -import {EffectActionWithStrength} from "./effect/EffectActions/EffectActionWithStrength.js"; -import {EffectActionWithBlend} from "./effect/EffectActions/EffectActionWithBlend.js"; -import {ViesusCorrectAdjustAction} from "./adjust/simple/ViesusCorrectAdjustAction.js"; -import {SimpleEffectAction} from "./effect/EffectActions/SimpleEffectAction.js"; -import {stringOrNumber} from "../types/types.js"; +import { FillLightAction } from "./adjust/FillLightAction.js"; +import { RecolorAction } from "./adjust/RecolorAction.js"; +import { OpacityAdjustAction } from "./adjust/OpacityAdjustAction.js"; +import { By3dLutAction } from "./adjust/By3dLutAction.js"; +import { ImproveAction } from "./adjust/ImproveAction.js"; +import { ReplaceColorAction } from "./adjust/ReplaceColorAction.js"; +import { EffectActionWithLevel } from "./effect/EffectActions/EffectActionWithLevel.js"; +import { EffectActionWithStrength } from "./effect/EffectActions/EffectActionWithStrength.js"; +import { EffectActionWithBlend } from "./effect/EffectActions/EffectActionWithBlend.js"; +import { ViesusCorrectAdjustAction } from "./adjust/simple/ViesusCorrectAdjustAction.js"; +import { SimpleEffectAction } from "./effect/EffectActions/SimpleEffectAction.js"; +import { stringOrNumber } from "../types/types.js"; /** * @description Adjusts the visual appearance of an image or video. @@ -17,9 +17,8 @@ import {stringOrNumber} from "../types/types.js"; * @namespace Adjust */ - - -export type IAdjustAction = FillLightAction +export type IAdjustAction = + | FillLightAction | RecolorAction | OpacityAdjustAction | By3dLutAction @@ -31,7 +30,6 @@ export type IAdjustAction = FillLightAction | ViesusCorrectAdjustAction | SimpleEffectAction; - /** * @summary action * @memberOf Actions.Adjust @@ -41,11 +39,10 @@ export type IAdjustAction = FillLightAction * @param {string} value The full tint effect value, provided as a string. * @return {Actions.Effect.SimpleEffectAction} */ -function tint(value: stringOrNumber = ''): SimpleEffectAction { - return new SimpleEffectAction('tint', value); +function tint(value: stringOrNumber = ""): SimpleEffectAction { + return new SimpleEffectAction("tint", value); } - /** * @summary action * @memberOf Actions.Adjust @@ -53,11 +50,10 @@ function tint(value: stringOrNumber = ''): SimpleEffectAction { * @param {number} level The level of brightness. (Range: -99 to 100, Server default: 80) * @return {Actions.Effect.EffectActionWithLevel} */ -function brightness(level?:number): EffectActionWithLevel { - return new EffectActionWithLevel('brightness', level); +function brightness(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("brightness", level); } - /** * @summary action * @memberOf Actions.Adjust @@ -77,8 +73,8 @@ function viesusCorrect(): ViesusCorrectAdjustAction { * @param {number} level The level of red. (Range: -100 to 100, Server default: 0) * @return {Actions.Effect.EffectActionWithLevel} */ -function red(level?:number): EffectActionWithLevel { - return new EffectActionWithLevel('red', level); +function red(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("red", level); } /** @@ -88,8 +84,8 @@ function red(level?:number): EffectActionWithLevel { * @param {number} strength The strength of the filter. (Range: 1 to 2000, Server default: 100) * @return {Actions.Effect.EffectActionWithStrength} */ -function sharpen(strength?:number):EffectActionWithStrength { - return new EffectActionWithStrength('sharpen', strength); +function sharpen(strength?: number): EffectActionWithStrength { + return new EffectActionWithStrength("sharpen", strength); } /** @@ -99,8 +95,8 @@ function sharpen(strength?:number):EffectActionWithStrength { * @param {number} level The level of color saturation (Range: -100 to 100, Server default: 80). * @return {Actions.Effect.EffectActionWithLevel} */ -function saturation(level?:number):EffectActionWithLevel { - return new EffectActionWithLevel('saturation', level); +function saturation(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("saturation", level); } /** @@ -110,8 +106,8 @@ function saturation(level?:number):EffectActionWithLevel { * @param {number} level The level of contrast. (Range: -100 to 100, Server default: 0) * @return {Actions.Effect.EffectActionWithLevel} */ -function contrast(level?:number):EffectActionWithLevel { - return new EffectActionWithLevel('contrast', level); +function contrast(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("contrast", level); } /** @@ -122,8 +118,8 @@ function contrast(level?:number):EffectActionWithLevel { * @param {number} level The level of gamma (Range: -50 to 150, Server default: 0). * @return {Actions.Effect.EffectActionWithLevel} */ -function gamma(level?:number):EffectActionWithLevel { - return new EffectActionWithLevel('gamma', level); +function gamma(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("gamma", level); } /** @@ -133,11 +129,10 @@ function gamma(level?:number):EffectActionWithLevel { * @param {number} level - The level of blue. (Range: -100 to 100, Server default: 0) * @return {Actions.Effect.EffectActionWithLevel} */ -function blue(level?:number): EffectActionWithLevel { - return new EffectActionWithLevel('blue', level); +function blue(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("blue", level); } - /** * @summary action * @memberOf Actions.Adjust @@ -146,8 +141,8 @@ function blue(level?:number): EffectActionWithLevel { * @param {number} level The level of modulation. (Range: -99 to 100, Server default: 80) * @return {Actions.Effect.EffectActionWithLevel} */ -function brightnessHSB(level?:number):EffectActionWithLevel { - return new EffectActionWithLevel('brightness_hsb', level); +function brightnessHSB(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("brightness_hsb", level); } /** @@ -164,11 +159,10 @@ function brightnessHSB(level?:number):EffectActionWithLevel { * @param {number} level The level of the threshold. (Range: 1 to 100, Server default: 50) * @return {Actions.Effect.EffectActionWithLevel} */ -function opacityThreshold(level?:number): EffectActionWithLevel { - return new EffectActionWithLevel('opacity_threshold', level); +function opacityThreshold(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("opacity_threshold", level); } - /** * @summary action * @memberOf Actions.Adjust @@ -178,11 +172,10 @@ function opacityThreshold(level?:number): EffectActionWithLevel { * (Range: 0 to 100, Server default: 100) * @return {Actions.Effect.EffectActionWithBlendPercentage} */ -function autoColor(blend?:number):EffectActionWithBlend { - return new EffectActionWithBlend('auto_color', blend); +function autoColor(blend?: number): EffectActionWithBlend { + return new EffectActionWithBlend("auto_color", blend); } - /** * @summary action * @memberOf Actions.Adjust @@ -193,8 +186,8 @@ function autoColor(blend?:number):EffectActionWithBlend { * (Range: 0 to 100, Server default: 100) * @return {Actions.Effect.EffectActionWithBlendPercentage} */ -function autoBrightness(blend?:number):EffectActionWithBlend { - return new EffectActionWithBlend('auto_brightness', blend); +function autoBrightness(blend?: number): EffectActionWithBlend { + return new EffectActionWithBlend("auto_brightness", blend); } /** @@ -205,11 +198,10 @@ function autoBrightness(blend?:number):EffectActionWithBlend { * @param {number} level The level of hue. (Range: -100 to 100, Server default: 80) * @return {Actions.Effect.EffectActionWithLevel} */ -function hue(level?:number):EffectActionWithLevel { - return new EffectActionWithLevel('hue', level); +function hue(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("hue", level); } - /** * @summary action * @memberOf Actions.Adjust @@ -217,8 +209,8 @@ function hue(level?:number):EffectActionWithLevel { * @param {number} level The level of green. (Range: -100 to 100, Server default: 0) * @return {Actions.Effect.EffectActionWithLevel} */ -function green(level?:number): EffectActionWithLevel { - return new EffectActionWithLevel('green', level); +function green(level?: number): EffectActionWithLevel { + return new EffectActionWithLevel("green", level); } /** @@ -228,8 +220,8 @@ function green(level?:number): EffectActionWithLevel { * @param {number} strength The strength of the filter. (Range: 1 to 2000, Server default: 100) * @return {Actions.Effect.EffectActionWithStrength} */ -function unsharpMask(strength?:number):EffectActionWithStrength { - return new EffectActionWithStrength('unsharp_mask', strength); +function unsharpMask(strength?: number): EffectActionWithStrength { + return new EffectActionWithStrength("unsharp_mask", strength); } /** @@ -239,8 +231,8 @@ function unsharpMask(strength?:number):EffectActionWithStrength { * @param {number} strength The strength of the vibrance. (Range: -100 to 100, Server default: 20) * @return {Actions.Effect.EffectActionWithStrength} */ -function vibrance(strength?:number):EffectActionWithStrength { - return new EffectActionWithStrength('vibrance', strength); +function vibrance(strength?: number): EffectActionWithStrength { + return new EffectActionWithStrength("vibrance", strength); } /** @@ -253,11 +245,10 @@ function vibrance(strength?:number):EffectActionWithStrength { * (Range: 0 to 100, Server default: 100) * @return {Actions.Effect.EffectActionWithBlendPercentage} */ -function autoContrast(blend?:number):EffectActionWithBlend { - return new EffectActionWithBlend('auto_contrast', blend); +function autoContrast(blend?: number): EffectActionWithBlend { + return new EffectActionWithBlend("auto_contrast", blend); } - /** * @summary action * @description Adjusts the opacity of the image and makes it semi-transparent. @@ -265,11 +256,10 @@ function autoContrast(blend?:number):EffectActionWithBlend { * @param {number} level * @return {Actions.Adjust.OpacityAdjustAction} */ -function opacity(level:number): OpacityAdjustAction { +function opacity(level: number): OpacityAdjustAction { return new OpacityAdjustAction(level); } - /** * @summary action * @memberOf Actions.Adjust @@ -302,7 +292,7 @@ function replaceColor(toColor: string): ReplaceColorAction { * @param {number[][]} matrix * @return {Actions.Adjust.RecolorAction} */ -function recolor(matrix:number[][]): RecolorAction { +function recolor(matrix: number[][]): RecolorAction { return new RecolorAction(matrix); } @@ -330,13 +320,57 @@ function by3dLut(publicId: string): By3dLutAction { return new By3dLutAction(publicId); } - - -const Adjust = {brightness, viesusCorrect, opacity, red, sharpen, improve, saturation, - contrast, gamma, green, blue, brightnessHSB, hue, autoBrightness, autoColor, - autoContrast, vibrance, unsharpMask, opacityThreshold, replaceColor, recolor, fillLight, by3dLut, tint}; - - -export {Adjust, brightness, viesusCorrect, opacity, red, sharpen, improve, saturation, - contrast, gamma, green, blue, brightnessHSB, hue, autoBrightness, autoColor, - autoContrast, vibrance, unsharpMask, opacityThreshold, replaceColor, recolor, fillLight, by3dLut, tint}; +const Adjust = { + brightness, + viesusCorrect, + opacity, + red, + sharpen, + improve, + saturation, + contrast, + gamma, + green, + blue, + brightnessHSB, + hue, + autoBrightness, + autoColor, + autoContrast, + vibrance, + unsharpMask, + opacityThreshold, + replaceColor, + recolor, + fillLight, + by3dLut, + tint, +}; + +export { + Adjust, + brightness, + viesusCorrect, + opacity, + red, + sharpen, + improve, + saturation, + contrast, + gamma, + green, + blue, + brightnessHSB, + hue, + autoBrightness, + autoColor, + autoContrast, + vibrance, + unsharpMask, + opacityThreshold, + replaceColor, + recolor, + fillLight, + by3dLut, + tint, +}; diff --git a/src/actions/adjust/By3dLutAction.ts b/src/actions/adjust/By3dLutAction.ts index 646809e..132291b 100644 --- a/src/actions/adjust/By3dLutAction.ts +++ b/src/actions/adjust/By3dLutAction.ts @@ -1,4 +1,4 @@ -import {Action} from "../../internal/Action.js"; +import { Action } from "../../internal/Action.js"; /** * @description Creates the 3D_lut layer transformation @@ -21,4 +21,4 @@ class By3dLutAction extends Action { } } -export {By3dLutAction}; +export { By3dLutAction }; diff --git a/src/actions/adjust/FillLightAction.ts b/src/actions/adjust/FillLightAction.ts index bef07d9..e64ed23 100644 --- a/src/actions/adjust/FillLightAction.ts +++ b/src/actions/adjust/FillLightAction.ts @@ -1,6 +1,6 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @description Adjusts the fill light and blends the result with the original image. @@ -8,8 +8,8 @@ import {Qualifier} from "../../internal/qualifier/Qualifier.js"; * @extends SDK.Action */ class FillLightAction extends Action { - private lvl:number; - private biasLvl:number; + private lvl: number; + private biasLvl: number; constructor() { super(); } @@ -18,7 +18,7 @@ class FillLightAction extends Action { * @description Sets the level of adjustment * @param {number} lvl How much to blend the adjusted fill light, where 0 means only use the original and 100 means only use the adjusted fill light result. (Range: 0 to 100, Server default: 100) */ - blend(blend:number): this { + blend(blend: number): this { this.lvl = blend; return this; } @@ -27,16 +27,16 @@ class FillLightAction extends Action { * @description Sets the level of the bias * @param {number} biasLvl The bias to apply to the fill light effect (Range: -100 to 100, Server default: 0). */ - bias(biasLvl:number): this { + bias(biasLvl: number): this { this.biasLvl = biasLvl; return this; } protected prepareQualifiers(): this { - const qualifierValue = new QualifierValue(['fill_light', this.lvl, this.biasLvl]).setDelimiter(':'); - this.addQualifier(new Qualifier('e', qualifierValue)); + const qualifierValue = new QualifierValue(["fill_light", this.lvl, this.biasLvl]).setDelimiter(":"); + this.addQualifier(new Qualifier("e", qualifierValue)); return this; } } -export {FillLightAction}; +export { FillLightAction }; diff --git a/src/actions/adjust/ImproveAction.ts b/src/actions/adjust/ImproveAction.ts index 2dac3b0..2dac6fb 100644 --- a/src/actions/adjust/ImproveAction.ts +++ b/src/actions/adjust/ImproveAction.ts @@ -1,9 +1,9 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {stringOrNumber} from "../../types/types.js"; -import {ImproveActionModel} from "../../internal/models/IAdjustActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { stringOrNumber } from "../../types/types.js"; +import { ImproveActionModel } from "../../internal/models/IAdjustActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Defines how to improve an image by automatically adjusting image colors, contrast and brightness.
      @@ -11,9 +11,9 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; * @memberOf Actions.Adjust */ class ImproveAction extends Action { - private modeValue:stringOrNumber; - private blendValue:number; - protected _actionModel: ImproveActionModel = {actionType: 'improve'}; + private modeValue: stringOrNumber; + private blendValue: number; + protected _actionModel: ImproveActionModel = { actionType: "improve" }; constructor() { super(); } @@ -23,7 +23,7 @@ class ImproveAction extends Action { * @description The improve mode. * @param {Qualifiers.ImproveMode | string} value */ - mode(value: 'outdoor' | 'indoor' | string): this { + mode(value: "outdoor" | "indoor" | string): this { this.modeValue = value; this._actionModel.mode = value; return this; @@ -33,20 +33,20 @@ class ImproveAction extends Action { * @description How much to blend the improved result with the original image, where 0 means only use the original and 100 means only use the improved result. (Range: 0 to 100, Server default: 100) * @param {number} value */ - blend(value:number): this { + blend(value: number): this { this.blendValue = value; this._actionModel.blend = value; return this; } protected prepareQualifiers(): this { - const qualifierValue = new QualifierValue(['improve', this.modeValue, this.blendValue]).setDelimiter(':'); - this.addQualifier(new Qualifier('e', qualifierValue)); + const qualifierValue = new QualifierValue(["improve", this.modeValue, this.blendValue]).setDelimiter(":"); + this.addQualifier(new Qualifier("e", qualifierValue)); return this; } - static fromJson(actionModel: IActionModel): ImproveAction{ - const {mode, blend} = (actionModel as ImproveActionModel); + static fromJson(actionModel: IActionModel): ImproveAction { + const { mode, blend } = actionModel as ImproveActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -58,4 +58,4 @@ class ImproveAction extends Action { } } -export {ImproveAction}; +export { ImproveAction }; diff --git a/src/actions/adjust/OpacityAdjustAction.ts b/src/actions/adjust/OpacityAdjustAction.ts index 7f00cac..0df944e 100644 --- a/src/actions/adjust/OpacityAdjustAction.ts +++ b/src/actions/adjust/OpacityAdjustAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {OpacityActionModel} from "../../internal/models/IOpacityActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { OpacityActionModel } from "../../internal/models/IOpacityActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description OpacityAction class, used to define the opacity of an asset @@ -10,17 +10,17 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; */ class OpacityAdjustAction extends Action { private level: number; - protected _actionModel: OpacityActionModel = {actionType: 'opacity'}; + protected _actionModel: OpacityActionModel = { actionType: "opacity" }; constructor(level: number) { super(); this.level = level; this._actionModel.level = level; - this.addQualifier(new Qualifier('o', level)); + this.addQualifier(new Qualifier("o", level)); } static fromJson(actionModel: IActionModel): OpacityAdjustAction { - const { level } = (actionModel as OpacityActionModel); + const { level } = actionModel as OpacityActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -28,4 +28,4 @@ class OpacityAdjustAction extends Action { } } -export {OpacityAdjustAction}; +export { OpacityAdjustAction }; diff --git a/src/actions/adjust/RecolorAction.ts b/src/actions/adjust/RecolorAction.ts index d7464f3..f0cf584 100644 --- a/src/actions/adjust/RecolorAction.ts +++ b/src/actions/adjust/RecolorAction.ts @@ -1,6 +1,6 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @extends SDK.Action @@ -10,24 +10,23 @@ import {Qualifier} from "../../internal/qualifier/Qualifier.js"; */ class RecolorAction extends Action { readonly matrix: number[][]; - constructor(recolorMatrix:number[][]) { + constructor(recolorMatrix: number[][]) { super(); this.matrix = recolorMatrix; // Turn the matrix into a flat array of values // the values are ordered by row // [...row1, ...row2, ...row3, ..., row(n) ] - const flat:string[] = []; + const flat: string[] = []; for (let row = 0; row < recolorMatrix.length; row++) { - for (let col = 0; col < recolorMatrix[row].length; col++) { flat.push(recolorMatrix[row][col].toString()); } } - const qualifierValue = new QualifierValue(['recolor', ...flat]).setDelimiter(':'); - this.addQualifier(new Qualifier('e', qualifierValue)); + const qualifierValue = new QualifierValue(["recolor", ...flat]).setDelimiter(":"); + this.addQualifier(new Qualifier("e", qualifierValue)); } } -export {RecolorAction}; +export { RecolorAction }; diff --git a/src/actions/adjust/ReplaceColorAction.ts b/src/actions/adjust/ReplaceColorAction.ts index 9525fa9..a95384e 100644 --- a/src/actions/adjust/ReplaceColorAction.ts +++ b/src/actions/adjust/ReplaceColorAction.ts @@ -1,6 +1,6 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @description @@ -19,7 +19,7 @@ class ReplaceColorAction extends Action { * @description Sets the target output color. * @param {string} toColor - The HTML name or RGB/A hex code of the target output color. */ - constructor(toColor:string) { + constructor(toColor: string) { super(); this.targetColor = toColor; } @@ -32,7 +32,7 @@ class ReplaceColorAction extends Action { * The more saturated the original input color, the more a change in value will impact the result (Server default: 50). * @return {this} */ - tolerance(toleranceLevel:number): this { + tolerance(toleranceLevel: number): this { this.toleranceLevel = toleranceLevel; return this; } @@ -42,7 +42,7 @@ class ReplaceColorAction extends Action { * @param {string} baseColor - The HTML name or RGB/A hex code of the base input color to map (Server default: the most prominent high-saturation color in the image). * @return {this} */ - fromColor(baseColor:string): this { + fromColor(baseColor: string): this { this.baseColor = baseColor; return this; } @@ -50,13 +50,13 @@ class ReplaceColorAction extends Action { protected prepareQualifiers(): this { // Target color and base color might not exist at this point (optional qualifiers) // If they exist, ensure that any # for RGB are removed from the resulting string - const targetColor = this.targetColor && this.targetColor.toString().replace('#', ''); - const baseColor = this.baseColor && this.baseColor.toString().replace('#', ''); + const targetColor = this.targetColor && this.targetColor.toString().replace("#", ""); + const baseColor = this.baseColor && this.baseColor.toString().replace("#", ""); - const qualifierValue = new QualifierValue(['replace_color', targetColor, this.toleranceLevel, baseColor]); - this.addQualifier(new Qualifier('e', qualifierValue)); + const qualifierValue = new QualifierValue(["replace_color", targetColor, this.toleranceLevel, baseColor]); + this.addQualifier(new Qualifier("e", qualifierValue)); return this; } } -export {ReplaceColorAction}; +export { ReplaceColorAction }; diff --git a/src/actions/adjust/simple/ViesusCorrectAdjustAction.ts b/src/actions/adjust/simple/ViesusCorrectAdjustAction.ts index bd949e1..7f5d413 100644 --- a/src/actions/adjust/simple/ViesusCorrectAdjustAction.ts +++ b/src/actions/adjust/simple/ViesusCorrectAdjustAction.ts @@ -1,5 +1,5 @@ -import {Action} from "../../../internal/Action.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; +import { Action } from "../../../internal/Action.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; /** * Enhances an image to its best visual quality with the Viesus Automatic Image Enhancement add-on.
      @@ -7,7 +7,7 @@ import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; * @memberOf Actions.Adjust */ class ViesusCorrectAdjustAction extends Action { - private _noRedEye : boolean; + private _noRedEye: boolean; private _skinSaturation: boolean; private _skinSaturationLevel: number; @@ -23,7 +23,7 @@ class ViesusCorrectAdjustAction extends Action { * @description Applies saturation to the skin tones in the image. * @param level The saturation level. (Range: -100 to 100, Server default: 50). */ - skinSaturation(level?:number): this { + skinSaturation(level?: number): this { this._skinSaturation = true; if (level) { this._skinSaturationLevel = level; @@ -32,20 +32,20 @@ class ViesusCorrectAdjustAction extends Action { } protected prepareQualifiers(): void { - let value = 'viesus_correct'; + let value = "viesus_correct"; if (this._noRedEye) { - value += ':no_redeye'; + value += ":no_redeye"; } if (this._skinSaturation) { - value += ':skin_saturation'; - if (typeof this._skinSaturationLevel !== 'undefined') { + value += ":skin_saturation"; + if (typeof this._skinSaturationLevel !== "undefined") { value += `_${this._skinSaturationLevel}`; } } - this.addQualifier(new Qualifier('e', value)); + this.addQualifier(new Qualifier("e", value)); } } -export {ViesusCorrectAdjustAction}; +export { ViesusCorrectAdjustAction }; diff --git a/src/actions/animated.ts b/src/actions/animated.ts index 72ff6fd..c2f906f 100644 --- a/src/actions/animated.ts +++ b/src/actions/animated.ts @@ -1,6 +1,6 @@ -import {Action} from "../internal/Action.js"; -import {Qualifier} from "../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../internal/qualifier/QualifierValue.js"; +import { Action } from "../internal/Action.js"; +import { Qualifier } from "../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../internal/qualifier/QualifierValue.js"; /** * @description Delivers an animated GIF that contains additional loops of the GIF. @@ -18,7 +18,6 @@ import {QualifierValue} from "../internal/qualifier/QualifierValue.js"; * image.animated(edit().delay(200).loop(3))); */ - /** * @memberOf Actions.Animated * @see Actions.Animated @@ -42,7 +41,7 @@ class AnimatedAction extends Action { * @return {this} */ delay(delayValue: number): this { - this.addQualifier(new Qualifier('dl', delayValue)); + this.addQualifier(new Qualifier("dl", delayValue)); return this; } @@ -52,11 +51,10 @@ class AnimatedAction extends Action { * @return {this} */ loop(additionalLoops?: number): this { - const qualifierValue = new QualifierValue(['loop', additionalLoops]).setDelimiter(':'); - this.addQualifier(new Qualifier('e', qualifierValue)); + const qualifierValue = new QualifierValue(["loop", additionalLoops]).setDelimiter(":"); + this.addQualifier(new Qualifier("e", qualifierValue)); return this; } - } /** @@ -70,8 +68,7 @@ function edit(): AnimatedAction { } const Animated = { - edit + edit, }; - -export {AnimatedAction, Animated, edit}; +export { AnimatedAction, Animated, edit }; diff --git a/src/actions/background/actions/BackgroundColor.ts b/src/actions/background/actions/BackgroundColor.ts index a6e78de..bdc52bd 100644 --- a/src/actions/background/actions/BackgroundColor.ts +++ b/src/actions/background/actions/BackgroundColor.ts @@ -1,7 +1,7 @@ -import {Action} from "../../../internal/Action.js"; -import {QualifierValue} from "../../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {SystemColors} from "../../../qualifiers/color.js"; +import { Action } from "../../../internal/Action.js"; +import { QualifierValue } from "../../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { SystemColors } from "../../../qualifiers/color.js"; /** * @extends SDK.Action @@ -10,8 +10,8 @@ import {SystemColors} from "../../../qualifiers/color.js"; class BackgroundColor extends Action { constructor(color: SystemColors) { super(); - this.addQualifier(new Qualifier('b', new QualifierValue(color).setDelimiter('_'))); + this.addQualifier(new Qualifier("b", new QualifierValue(color).setDelimiter("_"))); } } -export {BackgroundColor}; +export { BackgroundColor }; diff --git a/src/actions/border.ts b/src/actions/border.ts index 843b84a..1049ea6 100644 --- a/src/actions/border.ts +++ b/src/actions/border.ts @@ -1,11 +1,11 @@ -import {Action} from "../internal/Action.js"; -import {QualifierValue} from "../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../internal/qualifier/Qualifier.js"; -import {prepareColor} from "../internal/utils/prepareColor.js"; -import {SystemColors} from "../qualifiers/color.js"; +import { Action } from "../internal/Action.js"; +import { QualifierValue } from "../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../internal/qualifier/Qualifier.js"; +import { prepareColor } from "../internal/utils/prepareColor.js"; +import { SystemColors } from "../qualifiers/color.js"; import RoundCornersAction from "./roundCorners/RoundCornersAction.js"; -import {IBorderActionModel} from "../internal/models/IBorderActionModel.js"; -import {IActionModel} from "../internal/models/IActionModel.js"; +import { IBorderActionModel } from "../internal/models/IBorderActionModel.js"; +import { IActionModel } from "../internal/models/IActionModel.js"; /** * @description Adds a solid border around an image or video. @@ -28,8 +28,6 @@ import {IActionModel} from "../internal/models/IActionModel.js"; * */ - - /** * @memberOf Actions.Border * @see Actions.Border @@ -67,7 +65,7 @@ class BorderAction extends Action { this._actionModel = { color: prepareColor(color), width: borderWidth, - actionType: 'border', + actionType: "border", }; } @@ -109,7 +107,7 @@ class BorderAction extends Action { * @return {this} */ solid(width: number | string, color: SystemColors): BorderAction { - this.borderType = 'solid'; + this.borderType = "solid"; this.borderColor = prepareColor(color); this.borderWidth = width; @@ -120,24 +118,28 @@ class BorderAction extends Action { } protected prepareQualifiers(): void { - const qualifierValue = new QualifierValue([`${this.borderWidth}px`, this.borderType, `${this.borderColor}`]).setDelimiter('_'); - this.addQualifier(new Qualifier('bo', qualifierValue)); + const qualifierValue = new QualifierValue([ + `${this.borderWidth}px`, + this.borderType, + `${this.borderColor}`, + ]).setDelimiter("_"); + this.addQualifier(new Qualifier("bo", qualifierValue)); if (this._roundCorners) { - this.addQualifier(this._roundCorners.qualifiers.get('r')); + this.addQualifier(this._roundCorners.qualifiers.get("r")); } } static fromJson(actionModel: IActionModel): BorderAction { - const { width, color, radius } = (actionModel as IBorderActionModel); + const { width, color, radius } = actionModel as IBorderActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created - const result = new this('solid', color, width); + const result = new this("solid", color, width); if (radius) { const roundCornersAction = (() => { - if (radius === 'max') { + if (radius === "max") { return new RoundCornersAction().max(); } if (Array.isArray(radius)) { @@ -155,9 +157,6 @@ class BorderAction extends Action { } } - - - /** * @summary action * @memberOf Actions.Border @@ -167,10 +166,9 @@ class BorderAction extends Action { * @return {Actions.Border.BorderAction} */ function solid(width: number | string, color: SystemColors): BorderAction { - return new BorderAction('solid', color, width); + return new BorderAction("solid", color, width); } - /** * @summary action * @memberOf Actions.Border @@ -179,7 +177,7 @@ function solid(width: number | string, color: SystemColors): BorderAction { * @return {Actions.Border.BorderAction} */ function roundCorners(roundCorners: RoundCornersAction): BorderAction { - const borderActionInstance = new BorderAction('solid', 'transparent', 0); + const borderActionInstance = new BorderAction("solid", "transparent", 0); borderActionInstance.roundCorners(roundCorners); return borderActionInstance; } @@ -189,4 +187,4 @@ const Border = { roundCorners, }; -export {BorderAction, Border, solid, roundCorners}; +export { BorderAction, Border, solid, roundCorners }; diff --git a/src/actions/conditional.ts b/src/actions/conditional.ts index e88d27a..8849ade 100644 --- a/src/actions/conditional.ts +++ b/src/actions/conditional.ts @@ -1,8 +1,8 @@ -import {Action} from "../internal/Action.js"; -import {expression} from "../qualifiers/expression.js"; -import {Transformation} from "../transformation/Transformation.js"; -import {IConditionalActionModel} from "../internal/models/IConditionalActionModel.js"; -import {IActionModel} from "../internal/models/IActionModel.js"; +import { Action } from "../internal/Action.js"; +import { expression } from "../qualifiers/expression.js"; +import { Transformation } from "../transformation/Transformation.js"; +import { IConditionalActionModel } from "../internal/models/IConditionalActionModel.js"; +import { IActionModel } from "../internal/models/IActionModel.js"; /** * Sets up a conditional transformation. @@ -20,7 +20,6 @@ import {IActionModel} from "../internal/models/IActionModel.js"; * // Transformation will contain `if_ar_gte_1.0/w_100/if_end` */ - /** * @memberOf Actions.Conditional * @see Actions.Conditional @@ -36,8 +35,10 @@ import {IActionModel} from "../internal/models/IActionModel.js"; * image.toString() * // Transformation will contain `if_ar_gte_1.0/w_100/if_end` */ -class ConditionalAction extends Action{ - protected _actionModel: IConditionalActionModel = {actionType: "ifCondition"}; +class ConditionalAction extends Action { + protected _actionModel: IConditionalActionModel = { + actionType: "ifCondition", + }; private ifTx: Transformation; private elseTx: Transformation; private exp: string; @@ -67,16 +68,13 @@ class ConditionalAction extends Action{ } toString(): string { - return [ - `if_${expression(this.exp)}`, - `${this.ifTx}`, - this.elseTx && `if_else/${this.elseTx}`, - `if_end` - ].filter((a) => a).join('/'); + return [`if_${expression(this.exp)}`, `${this.ifTx}`, this.elseTx && `if_else/${this.elseTx}`, `if_end`] + .filter((a) => a) + .join("/"); } static fromJson(actionModel: IActionModel): ConditionalAction { - const {expression, transformation, otherwise} = (actionModel as IConditionalActionModel); + const { expression, transformation, otherwise } = actionModel as IConditionalActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -87,9 +85,6 @@ class ConditionalAction extends Action{ } } - - - /** * @summary action * @memberOf Actions.Conditional @@ -104,6 +99,6 @@ function ifCondition(expression: string, tx: Transformation): ConditionalAction return new ConditionalAction(expression, tx); } -const Conditional = {ifCondition, ConditionalAction}; +const Conditional = { ifCondition, ConditionalAction }; -export {Conditional, ifCondition, ConditionalAction}; +export { Conditional, ifCondition, ConditionalAction }; diff --git a/src/actions/customFunction.ts b/src/actions/customFunction.ts index ffecf4c..5d06147 100644 --- a/src/actions/customFunction.ts +++ b/src/actions/customFunction.ts @@ -18,7 +18,6 @@ * ); */ - import CustomFunctionAction from "./customFunction/CustomFunctionAction.js"; import RemoteAction from "./customFunction/RemoteAction.js"; @@ -30,9 +29,8 @@ import RemoteAction from "./customFunction/RemoteAction.js"; * @memberOf Actions.CustomFunction * @return {Actions.CustomFunctionAction} */ -function remote(path:string): RemoteAction { - return new RemoteAction(path) - .asRemote(); +function remote(path: string): RemoteAction { + return new RemoteAction(path).asRemote(); } /** @@ -43,11 +41,9 @@ function remote(path:string): RemoteAction { * @memberOf Actions.CustomFunction * @return {Actions.CustomFunctionAction} */ -function wasm(publicID:string): CustomFunctionAction { - return new CustomFunctionAction(publicID) - .asWasm(); +function wasm(publicID: string): CustomFunctionAction { + return new CustomFunctionAction(publicID).asWasm(); } - -const CustomFunction = {remote, wasm}; -export {CustomFunction, remote, wasm}; +const CustomFunction = { remote, wasm }; +export { CustomFunction, remote, wasm }; diff --git a/src/actions/customFunction/CustomFunctionAction.ts b/src/actions/customFunction/CustomFunctionAction.ts index 2a57e27..f140243 100644 --- a/src/actions/customFunction/CustomFunctionAction.ts +++ b/src/actions/customFunction/CustomFunctionAction.ts @@ -1,16 +1,16 @@ -import {base64Encode} from "../../internal/utils/base64Encode.js"; -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { base64Encode } from "../../internal/utils/base64Encode.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @memberOf Actions.CustomFunction * @see Visit {@link Actions.CustomFunction|Custom functions} for an example */ class CustomFunctionAction extends Action { - private mode: 'wasm' | 'remote' | string; - protected pre?: 'pre'; - readonly fn:string; + private mode: "wasm" | "remote" | string; + protected pre?: "pre"; + readonly fn: string; private encodedFn: string; /** @@ -22,7 +22,7 @@ class CustomFunctionAction extends Action { this.fn = fn; } - private encodeCustomFunctionString(fn:string):string { + private encodeCustomFunctionString(fn: string): string { const encodedSource = base64Encode(fn); return encodedSource; } @@ -32,7 +32,7 @@ class CustomFunctionAction extends Action { * Used with the builders of `remote` and `wasm` from {@link Actions.CustomFunction|Custom functions} */ asWasm(): this { - this.mode = 'wasm'; + this.mode = "wasm"; return this; } @@ -41,23 +41,21 @@ class CustomFunctionAction extends Action { * Used with the builders of `remote` and `wasm` from {@link Actions.CustomFunction|Custom functions} */ asRemote(): this { - this.mode = 'remote'; + this.mode = "remote"; return this; } - protected prepareQualifiers():this { + protected prepareQualifiers(): this { this.encodedFn = this.fn; - if (this.mode === 'remote') { + if (this.mode === "remote") { this.encodedFn = this.encodeCustomFunctionString(this.fn); } - return this.addQualifier(new Qualifier('fn', new QualifierValue([this.pre, this.mode, this.encodedFn]))); + return this.addQualifier(new Qualifier("fn", new QualifierValue([this.pre, this.mode, this.encodedFn]))); } toString(): string { - return super.toString() - .replace(/\//g, ':'); + return super.toString().replace(/\//g, ":"); } } - export default CustomFunctionAction; diff --git a/src/actions/customFunction/RemoteAction.ts b/src/actions/customFunction/RemoteAction.ts index 531473f..1bb707c 100644 --- a/src/actions/customFunction/RemoteAction.ts +++ b/src/actions/customFunction/RemoteAction.ts @@ -7,7 +7,7 @@ class RemoteAction extends CustomFunctionAction { super(fn); } preprocess(): this { - this.pre = 'pre'; + this.pre = "pre"; return this; } } diff --git a/src/actions/delivery.ts b/src/actions/delivery.ts index a7ac0bc..cb369cd 100644 --- a/src/actions/delivery.ts +++ b/src/actions/delivery.ts @@ -6,18 +6,22 @@ * See the examples under every method */ -import {DeliveryFormatAction} from "./delivery/DeliveryFormatAction.js"; -import {DeliveryQualityAction} from "./delivery/DeliveryQualityAction.js"; -import {FormatQualifier} from "../qualifiers/format/FormatQualifier.js"; -import {DeliveryColorSpaceFromICCAction} from "./delivery/DeliveryColorSpaceFromICCAction.js"; -import {DeliveryAction} from "./delivery/DeliveryAction.js"; -import {ColorSpaceType} from "../types/types.js"; -import {QualityTypes} from "../types/types.js"; -import {ImageFormatType, VideoFormatType} from "../types/types.js"; -import {DeliveryColorSpaceAction} from "./delivery/DeliveryColorSpaceAction.js"; -import {DeliveryDPRAction} from "./delivery/DeliveryDPRAction.js"; +import { DeliveryFormatAction } from "./delivery/DeliveryFormatAction.js"; +import { DeliveryQualityAction } from "./delivery/DeliveryQualityAction.js"; +import { FormatQualifier } from "../qualifiers/format/FormatQualifier.js"; +import { DeliveryColorSpaceFromICCAction } from "./delivery/DeliveryColorSpaceFromICCAction.js"; +import { DeliveryAction } from "./delivery/DeliveryAction.js"; +import { ColorSpaceType } from "../types/types.js"; +import { QualityTypes } from "../types/types.js"; +import { ImageFormatType, VideoFormatType } from "../types/types.js"; +import { DeliveryColorSpaceAction } from "./delivery/DeliveryColorSpaceAction.js"; +import { DeliveryDPRAction } from "./delivery/DeliveryDPRAction.js"; -export type IDeliveryAction = DeliveryAction | DeliveryColorSpaceAction | DeliveryColorSpaceFromICCAction | DeliveryDPRAction; +export type IDeliveryAction = + | DeliveryAction + | DeliveryColorSpaceAction + | DeliveryColorSpaceFromICCAction + | DeliveryDPRAction; /** * @summary action @@ -42,8 +46,8 @@ export type IDeliveryAction = DeliveryAction | DeliveryColorSpaceAction | Delive * ); * */ -function format(format:FormatQualifier | ImageFormatType | VideoFormatType | string) :DeliveryFormatAction { - return new DeliveryFormatAction('f', format); +function format(format: FormatQualifier | ImageFormatType | VideoFormatType | string): DeliveryFormatAction { + return new DeliveryFormatAction("f", format); } /** @@ -62,7 +66,7 @@ function format(format:FormatQualifier | ImageFormatType | VideoFormatType | str * dpr('2.0'), * ); */ -function dpr(dpr: string|number):DeliveryDPRAction { +function dpr(dpr: string | number): DeliveryDPRAction { return new DeliveryDPRAction(dpr); } @@ -88,7 +92,7 @@ function dpr(dpr: string|number):DeliveryDPRAction { * quality('auto'), * ); */ -function quality(qualityType:QualityTypes | string | number) :DeliveryQualityAction { +function quality(qualityType: QualityTypes | string | number): DeliveryQualityAction { return new DeliveryQualityAction(qualityType); } @@ -109,8 +113,8 @@ function quality(qualityType:QualityTypes | string | number) :DeliveryQualityAct * density(150), * ); */ -function density(value:number) :DeliveryAction { - return new DeliveryAction('dn', value, 'density'); +function density(value: number): DeliveryAction { + return new DeliveryAction("dn", value, "density"); } /** @@ -129,8 +133,8 @@ function density(value:number) :DeliveryAction { * defaultImage('sample'), * ); */ -function defaultImage(publicIdWithExtension:string) :DeliveryAction { - return new DeliveryAction('d', publicIdWithExtension, 'defaultImage'); +function defaultImage(publicIdWithExtension: string): DeliveryAction { + return new DeliveryAction("d", publicIdWithExtension, "defaultImage"); } /** @@ -184,8 +188,7 @@ const Delivery = { defaultImage, colorSpace, colorSpaceFromICC, - quality + quality, }; -export {Delivery, format, dpr, quality, density, defaultImage, colorSpace, colorSpaceFromICC}; - +export { Delivery, format, dpr, quality, density, defaultImage, colorSpace, colorSpaceFromICC }; diff --git a/src/actions/delivery/DeliveryAction.ts b/src/actions/delivery/DeliveryAction.ts index ddb0b7c..5fc6e89 100644 --- a/src/actions/delivery/DeliveryAction.ts +++ b/src/actions/delivery/DeliveryAction.ts @@ -1,13 +1,15 @@ -import {Action} from "../../internal/Action.js"; -import {FormatQualifier} from "../../qualifiers/format/FormatQualifier.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { Action } from "../../internal/Action.js"; +import { FormatQualifier } from "../../qualifiers/format/FormatQualifier.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; import { - IDefaultImageModel, IDeliveryColorSpaceActionModel, IDeliveryColorSpaceFromICCActionModel, - IDeliveryFormatModel, IDeliveryQualityModel, IDensityModel + IDefaultImageModel, + IDeliveryColorSpaceActionModel, + IDeliveryColorSpaceFromICCActionModel, + IDeliveryFormatModel, + IDeliveryQualityModel, + IDensityModel, } from "../../internal/models/IDeliveryActionModel.js"; -import { - DELIVERY_MODE_TO_ACTION_TYPE_MAP -} from "../../internal/internalConstants.js"; +import { DELIVERY_MODE_TO_ACTION_TYPE_MAP } from "../../internal/internalConstants.js"; /** * @description Qualifies the delivery of an asset. @@ -15,7 +17,13 @@ import { * @extends SDK.Action */ class DeliveryAction extends Action { - protected _actionModel: IDeliveryColorSpaceActionModel | IDeliveryColorSpaceFromICCActionModel | IDensityModel | IDefaultImageModel | IDeliveryFormatModel | IDeliveryQualityModel = {}; + protected _actionModel: + | IDeliveryColorSpaceActionModel + | IDeliveryColorSpaceFromICCActionModel + | IDensityModel + | IDefaultImageModel + | IDeliveryFormatModel + | IDeliveryQualityModel = {}; /** * @param {string} deliveryKey A generic Delivery Action Key (such as q, f, dn, etc.) @@ -23,13 +31,17 @@ class DeliveryAction extends Action { * @param {string} modelProperty internal model property of the action, for example quality uses `level` while dpr uses `density` * @see Visit {@link Actions.Delivery|Delivery} for an example */ - constructor(deliveryKey?: string, deliveryType?: FormatQualifier | string|number, modelProperty?: 'level' | 'density' | 'defaultImage' | 'colorSpaceType' | 'formatType') { + constructor( + deliveryKey?: string, + deliveryType?: FormatQualifier | string | number, + modelProperty?: "level" | "density" | "defaultImage" | "colorSpaceType" | "formatType" + ) { super(); let deliveryTypeValue; - if( deliveryType instanceof FormatQualifier){ + if (deliveryType instanceof FormatQualifier) { deliveryTypeValue = deliveryType.getValue(); - }else { + } else { deliveryTypeValue = deliveryType; } @@ -39,4 +51,4 @@ class DeliveryAction extends Action { } } -export {DeliveryAction}; +export { DeliveryAction }; diff --git a/src/actions/delivery/DeliveryColorSpaceAction.ts b/src/actions/delivery/DeliveryColorSpaceAction.ts index e422816..ce4206e 100644 --- a/src/actions/delivery/DeliveryColorSpaceAction.ts +++ b/src/actions/delivery/DeliveryColorSpaceAction.ts @@ -1,13 +1,13 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {ColorSpace} from "../../qualifiers/colorSpace.js"; -import {ColorSpaceType} from "../../types/types.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { ColorSpace } from "../../qualifiers/colorSpace.js"; +import { ColorSpaceType } from "../../types/types.js"; import { COLOR_SPACE_MODE_TO_COLOR_SPACE_MODEL_MODE_MAP, - COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP + COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP, } from "../../internal/internalConstants.js"; -import {IDeliveryColorSpaceActionModel, ColorSpaceModeType} from "../../internal/models/IDeliveryActionModel.js"; +import { IDeliveryColorSpaceActionModel, ColorSpaceModeType } from "../../internal/models/IDeliveryActionModel.js"; /** * @description Specifies the color space to use. @@ -26,15 +26,15 @@ class DeliveryColorSpaceAction extends Action { super(); this._actionModel = { - actionType: 'colorSpace', - mode: (COLOR_SPACE_MODE_TO_COLOR_SPACE_MODEL_MODE_MAP[mode] || mode) as ColorSpaceModeType + actionType: "colorSpace", + mode: (COLOR_SPACE_MODE_TO_COLOR_SPACE_MODEL_MODE_MAP[mode] || mode) as ColorSpaceModeType, }; - this.addQualifier(new Qualifier('cs', ColorSpace[mode] ? ColorSpace[mode]() : mode)); + this.addQualifier(new Qualifier("cs", ColorSpace[mode] ? ColorSpace[mode]() : mode)); } static fromJson(actionModel: IActionModel): DeliveryColorSpaceAction { - const {mode} = (actionModel as IDeliveryColorSpaceActionModel); + const { mode } = actionModel as IDeliveryColorSpaceActionModel; const colorSpaceMode = COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP[mode] || mode; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) @@ -43,4 +43,4 @@ class DeliveryColorSpaceAction extends Action { } } -export {DeliveryColorSpaceAction}; +export { DeliveryColorSpaceAction }; diff --git a/src/actions/delivery/DeliveryColorSpaceFromICCAction.ts b/src/actions/delivery/DeliveryColorSpaceFromICCAction.ts index 4c59311..1850a9e 100644 --- a/src/actions/delivery/DeliveryColorSpaceFromICCAction.ts +++ b/src/actions/delivery/DeliveryColorSpaceFromICCAction.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {IDeliveryColorSpaceFromICCActionModel} from "../../internal/models/IDeliveryActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { IDeliveryColorSpaceFromICCActionModel } from "../../internal/models/IDeliveryActionModel.js"; /** * @description Specifies the ICC profile to use for the color space. @@ -18,17 +18,17 @@ class DeliveryColorSpaceFromICCAction extends Action { */ constructor(publicId: string) { super(); - this._actionModel.actionType = 'colorSpaceFromICC'; + this._actionModel.actionType = "colorSpaceFromICC"; this._actionModel.publicId = publicId; - const qualifierValue = new QualifierValue(['icc', publicId]).setDelimiter(':'); - this.addQualifier(new Qualifier('cs', qualifierValue)); + const qualifierValue = new QualifierValue(["icc", publicId]).setDelimiter(":"); + this.addQualifier(new Qualifier("cs", qualifierValue)); } static fromJson(actionModel: IActionModel): DeliveryColorSpaceFromICCAction { - const {publicId} = (actionModel as IDeliveryColorSpaceFromICCActionModel); + const { publicId } = actionModel as IDeliveryColorSpaceFromICCActionModel; return new this(publicId); } } -export {DeliveryColorSpaceFromICCAction}; +export { DeliveryColorSpaceFromICCAction }; diff --git a/src/actions/delivery/DeliveryDPRAction.ts b/src/actions/delivery/DeliveryDPRAction.ts index fa5788f..7014a06 100644 --- a/src/actions/delivery/DeliveryDPRAction.ts +++ b/src/actions/delivery/DeliveryDPRAction.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {IDprModel} from "../../internal/models/IDeliveryActionModel.js"; -import {toFloatAsString} from "../../internal/utils/toFloatAsString.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { IDprModel } from "../../internal/models/IDeliveryActionModel.js"; +import { toFloatAsString } from "../../internal/utils/toFloatAsString.js"; /** * @description Specifies the dpr. @@ -11,7 +11,7 @@ import {toFloatAsString} from "../../internal/utils/toFloatAsString.js"; * @see Visit {@link Actions.Delivery|Delivery} for an example */ class DeliveryDPRAction extends Action { - protected _actionModel: IDprModel = { actionType: 'dpr'}; + protected _actionModel: IDprModel = { actionType: "dpr" }; /** * Create a new DeliveryDPRAction @@ -22,16 +22,15 @@ class DeliveryDPRAction extends Action { // toFloatAsString is used to ensure 1 turns into 1.0 const dprAsFloat = toFloatAsString(dprValue); this._actionModel.dpr = dprAsFloat; - this.addQualifier(new Qualifier('dpr', dprAsFloat)); + this.addQualifier(new Qualifier("dpr", dprAsFloat)); } - static fromJson(actionModel: IActionModel): DeliveryDPRAction { - const {dpr} = (actionModel as IDprModel); + const { dpr } = actionModel as IDprModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created return new this(dpr); } } -export {DeliveryDPRAction}; +export { DeliveryDPRAction }; diff --git a/src/actions/delivery/DeliveryFormatAction.ts b/src/actions/delivery/DeliveryFormatAction.ts index 12e1034..ff1a812 100644 --- a/src/actions/delivery/DeliveryFormatAction.ts +++ b/src/actions/delivery/DeliveryFormatAction.ts @@ -1,10 +1,10 @@ -import {lossy, preserveTransparency, progressive} from "../../qualifiers/flag.js"; -import {DeliveryAction} from "./DeliveryAction.js"; -import {ProgressiveQualifier} from "../../qualifiers/progressive.js"; -import {FormatQualifier} from "../../qualifiers/format/FormatQualifier.js"; -import {ProgressiveType} from "../../types/types.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {IDeliveryFormatModel} from "../../internal/models/IDeliveryActionModel.js"; +import { lossy, preserveTransparency, progressive } from "../../qualifiers/flag.js"; +import { DeliveryAction } from "./DeliveryAction.js"; +import { ProgressiveQualifier } from "../../qualifiers/progressive.js"; +import { FormatQualifier } from "../../qualifiers/format/FormatQualifier.js"; +import { ProgressiveType } from "../../types/types.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { IDeliveryFormatModel } from "../../internal/models/IDeliveryActionModel.js"; /** * @memberOf Actions.Delivery @@ -12,8 +12,8 @@ import {IDeliveryFormatModel} from "../../internal/models/IDeliveryActionModel.j * @see Visit {@link Actions.Delivery|Delivery} for an example */ class DeliveryFormatAction extends DeliveryAction { - constructor(deliveryKey?: string, deliveryType?: FormatQualifier|string|number) { - super(deliveryKey, deliveryType, 'formatType'); + constructor(deliveryKey?: string, deliveryType?: FormatQualifier | string | number) { + super(deliveryKey, deliveryType, "formatType"); } /** * @description Uses lossy compression when delivering animated GIF files. @@ -31,10 +31,10 @@ class DeliveryFormatAction extends DeliveryAction { */ progressive(mode?: ProgressiveType | ProgressiveQualifier): this { if (mode instanceof ProgressiveQualifier) { - this._actionModel.progressive = {mode: mode.getFlagValue()}; + this._actionModel.progressive = { mode: mode.getFlagValue() }; this.addFlag(mode); } else { - this._actionModel.progressive = {mode: mode}; + this._actionModel.progressive = { mode: mode }; this.addFlag(progressive(mode)); } return this; @@ -50,19 +50,19 @@ class DeliveryFormatAction extends DeliveryAction { } static fromJson(actionModel: IActionModel): DeliveryFormatAction { - const {formatType, lossy, progressive, preserveTransparency} = (actionModel as IDeliveryFormatModel); + const { formatType, lossy, progressive, preserveTransparency } = actionModel as IDeliveryFormatModel; let result: DeliveryFormatAction; if (formatType) { - result = new this('f', formatType); - } else{ - result = new this('f'); + result = new this("f", formatType); + } else { + result = new this("f"); } - if (progressive){ - if (progressive.mode){ + if (progressive) { + if (progressive.mode) { result.progressive(progressive.mode as unknown as ProgressiveQualifier); - } else{ + } else { result.progressive(); } } @@ -74,4 +74,4 @@ class DeliveryFormatAction extends DeliveryAction { } } -export {DeliveryFormatAction}; +export { DeliveryFormatAction }; diff --git a/src/actions/delivery/DeliveryQualityAction.ts b/src/actions/delivery/DeliveryQualityAction.ts index 5ff8ad9..2e93b63 100644 --- a/src/actions/delivery/DeliveryQualityAction.ts +++ b/src/actions/delivery/DeliveryQualityAction.ts @@ -1,14 +1,13 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {DeliveryAction} from "./DeliveryAction.js"; -import {IDeliveryQualityModel} from "../../internal/models/IDeliveryActionModel.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { DeliveryAction } from "./DeliveryAction.js"; +import { IDeliveryQualityModel } from "../../internal/models/IDeliveryActionModel.js"; import { CHROMA_VALUE_TO_CHROMA_MODEL_ENUM, CHROMA_MODEL_ENUM_TO_CHROMA_VALUE, - ACTION_TYPE_TO_QUALITY_MODE_MAP + ACTION_TYPE_TO_QUALITY_MODE_MAP, } from "../../internal/internalConstants.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; - +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Controls the quality of the delivered image or video. @@ -23,7 +22,7 @@ class DeliveryQualityAction extends DeliveryAction { * @param {Qualifiers.Quality} qualityValue a Quality value */ constructor(qualityValue: string | number) { - super( 'q', qualityValue.toString(), 'level'); + super("q", qualityValue.toString(), "level"); } /** @@ -34,29 +33,29 @@ class DeliveryQualityAction extends DeliveryAction { chromaSubSampling(type: 420 | 444 | number): this { this._actionModel.chromaSubSampling = CHROMA_VALUE_TO_CHROMA_MODEL_ENUM[type]; const qualityWithSubSampling = new QualifierValue([this._actionModel.level, type]); - qualityWithSubSampling.setDelimiter(':'); + qualityWithSubSampling.setDelimiter(":"); // We either have chroma or quantization, but not both - return this.addQualifier(new Qualifier('q', qualityWithSubSampling)); + return this.addQualifier(new Qualifier("q", qualityWithSubSampling)); } /** * Controls the final quality by setting a maximum quantization percentage * @param {number} val */ - quantization(val:number): this { + quantization(val: number): this { this._actionModel.quantization = val; - const qualityWithQuantization = new QualifierValue([this._actionModel.level, `qmax_${val}`]).setDelimiter(':'); + const qualityWithQuantization = new QualifierValue([this._actionModel.level, `qmax_${val}`]).setDelimiter(":"); // We either have chroma or quantization, but not both - return this.addQualifier(new Qualifier('q', qualityWithQuantization)); + return this.addQualifier(new Qualifier("q", qualityWithQuantization)); } static fromJson(actionModel: IActionModel): DeliveryQualityAction { - const {level, chromaSubSampling, quantization} = (actionModel as IDeliveryQualityModel); + const { level, chromaSubSampling, quantization } = actionModel as IDeliveryQualityModel; const levelType = ACTION_TYPE_TO_QUALITY_MODE_MAP[level] || level; const result = new this(levelType); - if (chromaSubSampling){ + if (chromaSubSampling) { //Turn strings like 'CHROMA_420' to 420 const chromaValue = CHROMA_MODEL_ENUM_TO_CHROMA_VALUE[chromaSubSampling.toUpperCase()]; chromaValue && result.chromaSubSampling(+chromaValue); @@ -68,4 +67,4 @@ class DeliveryQualityAction extends DeliveryAction { } } -export {DeliveryQualityAction}; +export { DeliveryQualityAction }; diff --git a/src/actions/effect.ts b/src/actions/effect.ts index a36283f..2978c1d 100644 --- a/src/actions/effect.ts +++ b/src/actions/effect.ts @@ -101,9 +101,7 @@ function oilPaint(oilPaintLevel?: number): EffectActionWithStrength { * @param {ArtisticFilterType | string} artisticFilterType * @return {Actions.Effect.SimpleEffectAction} */ -function artisticFilter( - artisticFilterType: ArtisticFilterType | string -): SimpleEffectAction { +function artisticFilter(artisticFilterType: ArtisticFilterType | string): SimpleEffectAction { return new SimpleEffectAction("art", artisticFilterType); } diff --git a/src/actions/effect/AssistColorBlind.ts b/src/actions/effect/AssistColorBlind.ts index ed9062a..d9418de 100644 --- a/src/actions/effect/AssistColorBlind.ts +++ b/src/actions/effect/AssistColorBlind.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IAssistColorBlindEffectModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IAssistColorBlindEffectModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Applies stripes to the image to help people with common color-blind conditions to differentiate between colors that are similar for them. @@ -15,17 +15,17 @@ class AssistColorBlindEffectAction extends Action { protected _actionModel: IAssistColorBlindEffectModel = {}; constructor() { super(); - this._actionModel.actionType = 'assistColorblind'; - this.addQualifier(new Qualifier('e', new QualifierValue('assist_colorblind'))); + this._actionModel.actionType = "assistColorblind"; + this.addQualifier(new Qualifier("e", new QualifierValue("assist_colorblind"))); } /** * @description Replaces problematic colors with colors that are easier to differentiate. * @return {this} */ - xray(): this{ - this._actionModel.type = 'xray'; - return this.addQualifier(new Qualifier('e', new QualifierValue(['assist_colorblind', 'xray']).setDelimiter(':'))); + xray(): this { + this._actionModel.type = "xray"; + return this.addQualifier(new Qualifier("e", new QualifierValue(["assist_colorblind", "xray"]).setDelimiter(":"))); } /** @@ -33,22 +33,22 @@ class AssistColorBlindEffectAction extends Action { * @param {number | string} strength The intensity of the stripes. (Range: 1 to 100, Server default: 10) * @return {this} */ - stripesStrength(strength:number | string): this { - this._actionModel.type = 'stripes'; + stripesStrength(strength: number | string): this { + this._actionModel.type = "stripes"; this._actionModel.stripesStrength = strength as number; - return this.addQualifier(new Qualifier('e', new QualifierValue(['assist_colorblind', strength]).setDelimiter(':'))); + return this.addQualifier(new Qualifier("e", new QualifierValue(["assist_colorblind", strength]).setDelimiter(":"))); } static fromJson(actionModel: IActionModel): AssistColorBlindEffectAction { - const {actionType, type, stripesStrength} = (actionModel as IAssistColorBlindEffectModel); + const { actionType, type, stripesStrength } = actionModel as IAssistColorBlindEffectModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(); - if (type === 'xray'){ + if (type === "xray") { result.xray(); } - if (type === 'stripes'){ + if (type === "stripes") { stripesStrength && result.stripesStrength(stripesStrength); } @@ -56,6 +56,4 @@ class AssistColorBlindEffectAction extends Action { } } -export {AssistColorBlindEffectAction}; - - +export { AssistColorBlindEffectAction }; diff --git a/src/actions/effect/BackgroundRemoval.ts b/src/actions/effect/BackgroundRemoval.ts index 34518df..9960e82 100644 --- a/src/actions/effect/BackgroundRemoval.ts +++ b/src/actions/effect/BackgroundRemoval.ts @@ -1,9 +1,9 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {ForegroundObjectValue} from "../../qualifiers/foregroundObject.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {IBackgroundRemovalModel} from "../../internal/models/IEffectActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { ForegroundObjectValue } from "../../qualifiers/foregroundObject.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { IBackgroundRemovalModel } from "../../internal/models/IEffectActionModel.js"; /** * @description A class that defines how to remove the background of an asset @@ -17,7 +17,7 @@ class BackgroundRemoval extends Action { constructor() { super(); - this._actionModel.actionType = 'backgroundRemoval'; + this._actionModel.actionType = "backgroundRemoval"; } fineEdges(value = true) { @@ -41,21 +41,21 @@ class BackgroundRemoval extends Action { } protected prepareQualifiers(): void { - let str = 'background_removal'; + let str = "background_removal"; if (this._fineEdges !== undefined) { - str += `:${new QualifierValue(`fineedges_${this._fineEdges ? 'y' : 'n'}`).toString()}`; + str += `:${new QualifierValue(`fineedges_${this._fineEdges ? "y" : "n"}`).toString()}`; } if (this._hints?.length) { - str += `:${new QualifierValue(`hints_(${this._hints.join(';')})`).toString()}`; + str += `:${new QualifierValue(`hints_(${this._hints.join(";")})`).toString()}`; } - this.addQualifier(new Qualifier('e', str)); + this.addQualifier(new Qualifier("e", str)); } static fromJson(actionModel: IActionModel): BackgroundRemoval { - const {fineEdges, hints} = (actionModel as IBackgroundRemovalModel); + const { fineEdges, hints } = actionModel as IBackgroundRemovalModel; const result = new this(); if (fineEdges !== undefined) { @@ -69,5 +69,4 @@ class BackgroundRemoval extends Action { } } - -export {BackgroundRemoval}; +export { BackgroundRemoval }; diff --git a/src/actions/effect/Cartoonify.ts b/src/actions/effect/Cartoonify.ts index b134afe..29e3010 100644 --- a/src/actions/effect/Cartoonify.ts +++ b/src/actions/effect/Cartoonify.ts @@ -1,8 +1,8 @@ -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Action} from "../../internal/Action.js"; -import {ICartoonifyEffectModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Action } from "../../internal/Action.js"; +import { ICartoonifyEffectModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Applies a cartoon effect to an image. @@ -15,7 +15,7 @@ class CartoonifyEffect extends Action { private colorReduction: number | string; private cartoonifyStrength: number; private effectName: string; - constructor(effectName:string, strength:number) { + constructor(effectName: string, strength: number) { // We don't pass level in the constructor, we'll build it in the prepareParam super(); this.cartoonifyStrength = strength; @@ -40,7 +40,7 @@ class CartoonifyEffect extends Action { */ blackwhite(): this { this._actionModel.blackAndWhite = true; - this.colorReduction = 'bw'; + this.colorReduction = "bw"; return this; } @@ -58,12 +58,14 @@ class CartoonifyEffect extends Action { } protected prepareQualifiers(): void { - this.addQualifier(new Qualifier('e', new QualifierValue([this.effectName, this.cartoonifyStrength, this.colorReduction]))); + this.addQualifier( + new Qualifier("e", new QualifierValue([this.effectName, this.cartoonifyStrength, this.colorReduction])) + ); return; } static fromJson(actionModel: IActionModel): CartoonifyEffect { - const {actionType, lineStrength, blackAndWhite, colorReductionLevel} = (actionModel as ICartoonifyEffectModel); + const { actionType, lineStrength, blackAndWhite, colorReductionLevel } = actionModel as ICartoonifyEffectModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -76,6 +78,4 @@ class CartoonifyEffect extends Action { } } - - -export {CartoonifyEffect}; +export { CartoonifyEffect }; diff --git a/src/actions/effect/Colorize.ts b/src/actions/effect/Colorize.ts index b09064f..51dd59e 100644 --- a/src/actions/effect/Colorize.ts +++ b/src/actions/effect/Colorize.ts @@ -1,10 +1,10 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {prepareColor} from "../../internal/utils/prepareColor.js"; -import {EffectActionWithLevel}from "./EffectActions/EffectActionWithLevel.js"; -import {SystemColors} from "../../qualifiers/color.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {IColorizeModel} from "../../internal/models/IEffectActionModel.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { prepareColor } from "../../internal/utils/prepareColor.js"; +import { EffectActionWithLevel } from "./EffectActions/EffectActionWithLevel.js"; +import { SystemColors } from "../../qualifiers/color.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { IColorizeModel } from "../../internal/models/IEffectActionModel.js"; /** * @description Applies a colorizing filter to the asset, use the methods in the class to adjust the filter @@ -20,11 +20,11 @@ class ColorizeEffectAction extends EffectActionWithLevel { */ color(color: SystemColors): this { this._actionModel.color = color; - return this.addQualifier(new Qualifier('co', new QualifierValue(prepareColor(color)))); + return this.addQualifier(new Qualifier("co", new QualifierValue(prepareColor(color)))); } static fromJson(actionModel: IActionModel): ColorizeEffectAction { - const {actionType, level, color} = (actionModel as IColorizeModel); + const { actionType, level, color } = actionModel as IColorizeModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -35,5 +35,4 @@ class ColorizeEffectAction extends EffectActionWithLevel { } } - -export {ColorizeEffectAction}; +export { ColorizeEffectAction }; diff --git a/src/actions/effect/Dither.ts b/src/actions/effect/Dither.ts index eb8a4f6..ebc345b 100644 --- a/src/actions/effect/Dither.ts +++ b/src/actions/effect/Dither.ts @@ -1,6 +1,6 @@ -import {LeveledEffectAction} from "./EffectActions/LeveledEffectAction.js"; -import {IDitherModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { LeveledEffectAction } from "./EffectActions/LeveledEffectAction.js"; +import { IDitherModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Applies an ordered dither filter to the image. @@ -9,13 +9,13 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; * @see Visit {@link Actions.Effect|Effect} for an example */ class DitherEffectAction extends LeveledEffectAction { - protected _actionModel: IDitherModel = {actionType: 'dither'}; + protected _actionModel: IDitherModel = { actionType: "dither" }; /** * * @param {Qualifiers.Dither} ditherType - The dither type applied to the image * @return {this} */ - type(ditherType:number): this { + type(ditherType: number): this { this._actionModel.type = ditherType; const qualifierEffect = this.createEffectQualifier(this.effectType, ditherType); this.addQualifier(qualifierEffect); @@ -23,7 +23,7 @@ class DitherEffectAction extends LeveledEffectAction { } static fromJson(actionModel: IActionModel): DitherEffectAction { - const {actionType, type} = (actionModel as IDitherModel); + const { actionType, type } = actionModel as IDitherModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -34,5 +34,4 @@ class DitherEffectAction extends LeveledEffectAction { } } - -export {DitherEffectAction}; +export { DitherEffectAction }; diff --git a/src/actions/effect/DropShadow.ts b/src/actions/effect/DropShadow.ts index 2eb7553..1928679 100644 --- a/src/actions/effect/DropShadow.ts +++ b/src/actions/effect/DropShadow.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IDropShadowModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IDropShadowModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Adds a shadow to the object in an image. @@ -13,12 +13,12 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; class DropShadow extends Action { private _azimuth: number; private _elevation: number; - private _spread : number; + private _spread: number; protected _actionModel: IDropShadowModel = {}; constructor() { super(); - this._actionModel.actionType = 'dropshadow'; + this._actionModel.actionType = "dropshadow"; } /** @@ -27,7 +27,7 @@ class DropShadow extends Action { * @param {number} azimuth * @return {this} */ - azimuth(azimuth?: number): this{ + azimuth(azimuth?: number): this { this._actionModel.azimuth = azimuth; this._azimuth = azimuth; return this; @@ -57,19 +57,19 @@ class DropShadow extends Action { return this; } - protected prepareQualifiers() : void { - const paramNames = ['azimuth', 'elevation', 'spread']; + protected prepareQualifiers(): void { + const paramNames = ["azimuth", "elevation", "spread"]; const paramValues = [this._azimuth, this._elevation, this._spread]; - const paramString = paramValues.map((value, index) => value !== undefined ? `${paramNames[index]}_${value}` : '').filter(Boolean).join(';'); + const paramString = paramValues + .map((value, index) => (value !== undefined ? `${paramNames[index]}_${value}` : "")) + .filter(Boolean) + .join(";"); - this.addQualifier(new Qualifier( - 'e', - new QualifierValue(['dropshadow', paramString]).setDelimiter(':')) - ); + this.addQualifier(new Qualifier("e", new QualifierValue(["dropshadow", paramString]).setDelimiter(":"))); } static fromJson(actionModel: IActionModel): DropShadow { - const {azimuth, elevation, spread} = (actionModel as IDropShadowModel); + const { azimuth, elevation, spread } = actionModel as IDropShadowModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -82,6 +82,4 @@ class DropShadow extends Action { } } - - -export {DropShadow}; +export { DropShadow }; diff --git a/src/actions/effect/EffectActions/EffectActionWithBlend.ts b/src/actions/effect/EffectActions/EffectActionWithBlend.ts index e70bd3b..9d89d54 100644 --- a/src/actions/effect/EffectActions/EffectActionWithBlend.ts +++ b/src/actions/effect/EffectActions/EffectActionWithBlend.ts @@ -1,4 +1,4 @@ -import {LeveledEffectAction} from "./LeveledEffectAction.js"; +import { LeveledEffectAction } from "./LeveledEffectAction.js"; /** * @description A class for all effects that include a blendPercentage method @@ -12,4 +12,4 @@ class EffectActionWithBlend extends LeveledEffectAction { } } -export {EffectActionWithBlend}; +export { EffectActionWithBlend }; diff --git a/src/actions/effect/EffectActions/EffectActionWithLevel.ts b/src/actions/effect/EffectActions/EffectActionWithLevel.ts index f758e9d..dc4a604 100644 --- a/src/actions/effect/EffectActions/EffectActionWithLevel.ts +++ b/src/actions/effect/EffectActions/EffectActionWithLevel.ts @@ -1,4 +1,4 @@ -import {LeveledEffectAction} from "./LeveledEffectAction.js"; +import { LeveledEffectAction } from "./LeveledEffectAction.js"; /** * @description A class that provides a built in level() method that sets the level of the effect @@ -13,4 +13,4 @@ class EffectActionWithLevel extends LeveledEffectAction { } } -export {EffectActionWithLevel}; +export { EffectActionWithLevel }; diff --git a/src/actions/effect/EffectActions/EffectActionWithStrength.ts b/src/actions/effect/EffectActions/EffectActionWithStrength.ts index 760eff7..76eb077 100644 --- a/src/actions/effect/EffectActions/EffectActionWithStrength.ts +++ b/src/actions/effect/EffectActions/EffectActionWithStrength.ts @@ -1,4 +1,4 @@ -import {LeveledEffectAction} from "./LeveledEffectAction.js"; +import { LeveledEffectAction } from "./LeveledEffectAction.js"; /** * @description A class for all effects that include a strength method @@ -7,11 +7,11 @@ import {LeveledEffectAction} from "./LeveledEffectAction.js"; * @see Visit {@link Actions.Effect|Effect} for an example */ class EffectActionWithStrength extends LeveledEffectAction { - LEVEL_NAME = 'strength'; + LEVEL_NAME = "strength"; strength(value: number | string): this { return this.setLevel(value); } } -export {EffectActionWithStrength}; +export { EffectActionWithStrength }; diff --git a/src/actions/effect/EffectActions/LeveledEffectAction.ts b/src/actions/effect/EffectActions/LeveledEffectAction.ts index 6ea02f3..0682ed6 100644 --- a/src/actions/effect/EffectActions/LeveledEffectAction.ts +++ b/src/actions/effect/EffectActions/LeveledEffectAction.ts @@ -1,7 +1,7 @@ -import {SimpleEffectAction} from "./SimpleEffectAction.js"; -import {ExpressionQualifier} from "../../../qualifiers/expression/ExpressionQualifier.js"; -import {IColorizeModel, IEffectActionWithLevelModel} from "../../../internal/models/IEffectActionModel.js"; -import {EFFECT_MODE_TO_ACTION_TYPE_MAP} from "../../../internal/internalConstants.js"; +import { SimpleEffectAction } from "./SimpleEffectAction.js"; +import { ExpressionQualifier } from "../../../qualifiers/expression/ExpressionQualifier.js"; +import { IColorizeModel, IEffectActionWithLevelModel } from "../../../internal/models/IEffectActionModel.js"; +import { EFFECT_MODE_TO_ACTION_TYPE_MAP } from "../../../internal/internalConstants.js"; /** * @description A base class for effects with a level, the extending class needs to implement a method that calls setLevel() * @extends {Actions.Effect.SimpleEffectAction} @@ -9,15 +9,15 @@ import {EFFECT_MODE_TO_ACTION_TYPE_MAP} from "../../../internal/internalConstant * @see Visit {@link Actions.Effect|Effect} for an example */ class LeveledEffectAction extends SimpleEffectAction { - protected LEVEL_NAME = 'level'; + protected LEVEL_NAME = "level"; protected _actionModel: IEffectActionWithLevelModel | IColorizeModel = {}; protected effectType: string; - constructor(effectType?: string, level?: number|string) { + constructor(effectType?: string, level?: number | string) { super(effectType, level); this.effectType = effectType; this._actionModel.actionType = EFFECT_MODE_TO_ACTION_TYPE_MAP[effectType] || effectType; - if(level){ + if (level) { this.setLevel(level); } } @@ -36,4 +36,4 @@ class LeveledEffectAction extends SimpleEffectAction { } } -export {LeveledEffectAction}; +export { LeveledEffectAction }; diff --git a/src/actions/effect/EffectActions/SimpleEffectAction.ts b/src/actions/effect/EffectActions/SimpleEffectAction.ts index 5c481ae..50576b9 100644 --- a/src/actions/effect/EffectActions/SimpleEffectAction.ts +++ b/src/actions/effect/EffectActions/SimpleEffectAction.ts @@ -1,11 +1,11 @@ -import {Action} from "../../../internal/Action.js"; -import {QualifierValue} from "../../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {ExpressionQualifier} from "../../../qualifiers/expression/ExpressionQualifier.js"; -import {ACTION_TYPE_TO_EFFECT_MODE_MAP, EFFECT_MODE_TO_ACTION_TYPE_MAP} from "../../../internal/internalConstants.js"; -import {ISimpleEffectActionModel} from "../../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; -import {IEffectActionWithLevelModel} from "../../../internal/models/IEffectActionModel.js"; +import { Action } from "../../../internal/Action.js"; +import { QualifierValue } from "../../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { ExpressionQualifier } from "../../../qualifiers/expression/ExpressionQualifier.js"; +import { ACTION_TYPE_TO_EFFECT_MODE_MAP, EFFECT_MODE_TO_ACTION_TYPE_MAP } from "../../../internal/internalConstants.js"; +import { ISimpleEffectActionModel } from "../../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; +import { IEffectActionWithLevelModel } from "../../../internal/models/IEffectActionModel.js"; /** * @description A class that defines a simple effect of the type e_{effectName} @@ -15,25 +15,25 @@ import {IEffectActionWithLevelModel} from "../../../internal/models/IEffectActio */ class SimpleEffectAction extends Action { protected _actionModel: ISimpleEffectActionModel = {}; - constructor(effectType?: string, level?: number|string) { + constructor(effectType?: string, level?: number | string) { super(); this._actionModel.actionType = EFFECT_MODE_TO_ACTION_TYPE_MAP[effectType] || effectType; const qualifierEffect = this.createEffectQualifier(effectType, level); this.addQualifier(qualifierEffect); } - protected createEffectQualifier(effectType: string, level?: number|string|ExpressionQualifier):Qualifier { + protected createEffectQualifier(effectType: string, level?: number | string | ExpressionQualifier): Qualifier { let qualifierValue; - if(level) { - qualifierValue = new QualifierValue([effectType, `${level}`]).setDelimiter(':'); + if (level) { + qualifierValue = new QualifierValue([effectType, `${level}`]).setDelimiter(":"); } else { qualifierValue = new QualifierValue(effectType); } - return new Qualifier('e', qualifierValue); + return new Qualifier("e", qualifierValue); } static fromJson(actionModel: IActionModel): SimpleEffectAction { - const {actionType, level, strength} = (actionModel as IEffectActionWithLevelModel); + const { actionType, level, strength } = actionModel as IEffectActionWithLevelModel; const effectType = ACTION_TYPE_TO_EFFECT_MODE_MAP[actionType] || actionType; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) @@ -45,4 +45,4 @@ class SimpleEffectAction extends Action { } } -export {SimpleEffectAction}; +export { SimpleEffectAction }; diff --git a/src/actions/effect/GenerativeRemove.ts b/src/actions/effect/GenerativeRemove.ts index 1f1a98e..7024008 100644 --- a/src/actions/effect/GenerativeRemove.ts +++ b/src/actions/effect/GenerativeRemove.ts @@ -95,9 +95,7 @@ class GenerativeRemove extends Action { private preparePromptsQualifier() { const prompts = this._prompts; - const str = `gen_remove:${new QualifierValue( - `prompt_(${prompts.join(";")})` - ).toString()}`; + const str = `gen_remove:${new QualifierValue(`prompt_(${prompts.join(";")})`).toString()}`; this.addQualifier(new Qualifier("e", str)); } @@ -105,9 +103,7 @@ class GenerativeRemove extends Action { private prepareRegionQualifier() { const region = this.stringifyRegion(this._regions[0]); - const str = `gen_remove:${new QualifierValue( - `region_${region}` - ).toString()}`; + const str = `gen_remove:${new QualifierValue(`region_${region}`).toString()}`; this.addQualifier(new Qualifier("e", str)); } @@ -115,9 +111,7 @@ class GenerativeRemove extends Action { private prepareRegionsQualifier() { const regions = this._regions.map((region) => this.stringifyRegion(region)); - const str = `gen_remove:${new QualifierValue( - `region_(${regions.join(";")})` - ).toString()}`; + const str = `gen_remove:${new QualifierValue(`region_(${regions.join(";")})`).toString()}`; this.addQualifier(new Qualifier("e", str)); } diff --git a/src/actions/effect/GradientFade.ts b/src/actions/effect/GradientFade.ts index 082245c..09b5390 100644 --- a/src/actions/effect/GradientFade.ts +++ b/src/actions/effect/GradientFade.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IGradientFadeEffecModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IGradientFadeEffecModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Applies a gradient fade effect from one edge of the image. @@ -12,13 +12,15 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; class GradientFadeEffectAction extends Action { private _strength: number; private _type: string; - protected _actionModel: IGradientFadeEffecModel = {actionType: 'gradientFade'}; + protected _actionModel: IGradientFadeEffecModel = { + actionType: "gradientFade", + }; /** * @description Sets the strength of the fade effect. * @param {number} strength The strength of the fade effect. (Range: 0 to 100, Server default: 20) */ - strength(strength:number): this { + strength(strength: number): this { this._actionModel.strength = strength; this._strength = strength; return this; @@ -28,7 +30,7 @@ class GradientFadeEffectAction extends Action { * @description Sets the mode of gradient fade. * @param {string | Qualifiers.GradientFade} type The mode of gradient fade. */ - type(type:string): this { + type(type: string): this { this._actionModel.type = type; this._type = type; return this; @@ -38,22 +40,22 @@ class GradientFadeEffectAction extends Action { * @description Sets the x dimension of the start point. * @param {number | string} x The x dimension of the start point. */ - horizontalStartPoint(x:number | string): this { + horizontalStartPoint(x: number | string): this { this._actionModel.horizontalStartPoint = x as string; - return this.addQualifier(new Qualifier('x', x)); + return this.addQualifier(new Qualifier("x", x)); } /** * @description Sets the y dimension of the start point. * @param {number | string} y The y dimension of the start point. */ - verticalStartPoint(y:number | string): this { + verticalStartPoint(y: number | string): this { this._actionModel.verticalStartPoint = y as string; - return this.addQualifier(new Qualifier('y', y)); + return this.addQualifier(new Qualifier("y", y)); } protected prepareQualifiers(): void { - let str = 'gradient_fade'; + let str = "gradient_fade"; if (this._type) { str += `:${this._type}`; } @@ -62,11 +64,12 @@ class GradientFadeEffectAction extends Action { str += `:${this._strength}`; } - this.addQualifier(new Qualifier('e', str)); + this.addQualifier(new Qualifier("e", str)); } static fromJson(actionModel: IActionModel): GradientFadeEffectAction { - const {actionType, verticalStartPoint, horizontalStartPoint, type, strength} = (actionModel as IGradientFadeEffecModel); + const { actionType, verticalStartPoint, horizontalStartPoint, type, strength } = + actionModel as IGradientFadeEffecModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -80,4 +83,4 @@ class GradientFadeEffectAction extends Action { } } -export {GradientFadeEffectAction}; +export { GradientFadeEffectAction }; diff --git a/src/actions/effect/Outline.ts b/src/actions/effect/Outline.ts index 6e99a96..13508fb 100644 --- a/src/actions/effect/Outline.ts +++ b/src/actions/effect/Outline.ts @@ -1,11 +1,11 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {prepareColor} from "../../internal/utils/prepareColor.js"; -import {SystemColors} from "../../qualifiers/color.js"; -import {OutlineModeType} from "../../types/types.js"; -import {IEffectOutlineModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { prepareColor } from "../../internal/utils/prepareColor.js"; +import { SystemColors } from "../../qualifiers/color.js"; +import { OutlineModeType } from "../../types/types.js"; +import { IEffectOutlineModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Adds an outline to a transparent image. For examples, see the Image Transformations guide. @@ -16,12 +16,12 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; class EffectOutline extends Action { private _mode: string; private _width: number | string; - private _blurLevel : number | string; + private _blurLevel: number | string; protected _actionModel: IEffectOutlineModel = {}; constructor() { super(); - this._actionModel.actionType = 'outline'; + this._actionModel.actionType = "outline"; } /** @@ -31,7 +31,7 @@ class EffectOutline extends Action { * @param {OutlineModeType|string} mode The type of outline effect. Use the constants defined in Outline. * @return {this} */ - mode(mode?: OutlineModeType|string): this{ + mode(mode?: OutlineModeType | string): this { this._actionModel.mode = mode; this._mode = mode; return this; @@ -42,7 +42,7 @@ class EffectOutline extends Action { * @param {number} width * @return {this} */ - width(width?:number | string): this { + width(width?: number | string): this { this._actionModel.width = width as number; this._width = width; return this; @@ -65,20 +65,19 @@ class EffectOutline extends Action { * @param {string | Qualifiers.Color} color One of the SDK Color values, string, or rgba: '#fff' * @return {this} */ - color(color:SystemColors): this { + color(color: SystemColors): this { this._actionModel.color = color; - return this.addQualifier(new Qualifier('co', prepareColor(color))); + return this.addQualifier(new Qualifier("co", prepareColor(color))); } - protected prepareQualifiers() : void { - this.addQualifier(new Qualifier( - 'e', - new QualifierValue(['outline', this._mode, this._width, this._blurLevel]).setDelimiter(':')) + protected prepareQualifiers(): void { + this.addQualifier( + new Qualifier("e", new QualifierValue(["outline", this._mode, this._width, this._blurLevel]).setDelimiter(":")) ); } static fromJson(actionModel: IActionModel): EffectOutline { - const {actionType, mode, color, blurLevel, width} = (actionModel as IEffectOutlineModel); + const { actionType, mode, color, blurLevel, width } = actionModel as IEffectOutlineModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -92,6 +91,4 @@ class EffectOutline extends Action { } } - - -export {EffectOutline}; +export { EffectOutline }; diff --git a/src/actions/effect/RemoveBackgroundAction.ts b/src/actions/effect/RemoveBackgroundAction.ts index 39c8fe8..33a1b15 100644 --- a/src/actions/effect/RemoveBackgroundAction.ts +++ b/src/actions/effect/RemoveBackgroundAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {SystemColors} from "../../qualifiers/color.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { SystemColors } from "../../qualifiers/color.js"; /** * @description A class that defines how to remove the background of an asset @@ -23,8 +23,8 @@ class RemoveBackgroundAction extends Action { * @private */ private overwriteQualifier(): this { - const value = ['bgremoval', this._screen ? 'screen' : '', (this._colorToRemove || '').replace('#', '')]; - return this.addQualifier(new Qualifier('e', new QualifierValue(value))); + const value = ["bgremoval", this._screen ? "screen" : "", (this._colorToRemove || "").replace("#", "")]; + return this.addQualifier(new Qualifier("e", new QualifierValue(value))); } /** @@ -48,5 +48,4 @@ class RemoveBackgroundAction extends Action { } } - -export {RemoveBackgroundAction}; +export { RemoveBackgroundAction }; diff --git a/src/actions/effect/Shadow.ts b/src/actions/effect/Shadow.ts index fe2dab0..123741d 100644 --- a/src/actions/effect/Shadow.ts +++ b/src/actions/effect/Shadow.ts @@ -1,11 +1,11 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {prepareColor} from "../../internal/utils/prepareColor.js"; -import {SystemColors} from "../../qualifiers/color.js"; -import {ExpressionQualifier} from "../../qualifiers/expression/ExpressionQualifier.js"; -import {IShadowEffectActionModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { prepareColor } from "../../internal/utils/prepareColor.js"; +import { SystemColors } from "../../qualifiers/color.js"; +import { ExpressionQualifier } from "../../qualifiers/expression/ExpressionQualifier.js"; +import { IShadowEffectActionModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Applies a shadow filter to the asset. @@ -21,7 +21,7 @@ class ShadowEffectAction extends Action { super(); this._actionModel.actionType = effectType; this.effectType = effectType; - this.addQualifier(new Qualifier('e', new QualifierValue(['shadow', strength]))); + this.addQualifier(new Qualifier("e", new QualifierValue(["shadow", strength]))); } /** @@ -31,7 +31,7 @@ class ShadowEffectAction extends Action { */ strength(strength: number): this { this._actionModel.strength = strength; - return this.addQualifier(new Qualifier('e', new QualifierValue(['shadow', strength]))); + return this.addQualifier(new Qualifier("e", new QualifierValue(["shadow", strength]))); } /** @@ -39,9 +39,9 @@ class ShadowEffectAction extends Action { * @param {number | SDK.ExpressionQualifier} x * @return {this} */ - offsetX(x:number | ExpressionQualifier): this { + offsetX(x: number | ExpressionQualifier): this { this._actionModel.offsetX = x as number; - return this.addQualifier(new Qualifier('x', new QualifierValue(x))); + return this.addQualifier(new Qualifier("x", new QualifierValue(x))); } /** @@ -49,9 +49,9 @@ class ShadowEffectAction extends Action { * @param {number | SDK.ExpressionQualifier} y * @return {this} */ - offsetY(y:number | ExpressionQualifier): this { + offsetY(y: number | ExpressionQualifier): this { this._actionModel.offsetY = y as number; - return this.addQualifier(new Qualifier('y', new QualifierValue(y))); + return this.addQualifier(new Qualifier("y", new QualifierValue(y))); } /** @@ -59,13 +59,13 @@ class ShadowEffectAction extends Action { * @param color * @return {this} */ - color(color:SystemColors): this { + color(color: SystemColors): this { this._actionModel.color = color; - return this.addQualifier(new Qualifier('co', new QualifierValue(prepareColor(color)))); + return this.addQualifier(new Qualifier("co", new QualifierValue(prepareColor(color)))); } static fromJson(actionModel: IActionModel): ShadowEffectAction { - const {actionType, strength, offsetX, offsetY, color} = (actionModel as IShadowEffectActionModel); + const { actionType, strength, offsetX, offsetY, color } = actionModel as IShadowEffectActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -78,5 +78,4 @@ class ShadowEffectAction extends Action { } } - -export {ShadowEffectAction}; +export { ShadowEffectAction }; diff --git a/src/actions/effect/SimulateColorBlind.ts b/src/actions/effect/SimulateColorBlind.ts index dce5b0d..ec0ed3d 100644 --- a/src/actions/effect/SimulateColorBlind.ts +++ b/src/actions/effect/SimulateColorBlind.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {SimulateColorBlindType} from "../../types/types.js"; -import {ISimulateColorBlindEffectModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { SimulateColorBlindType } from "../../types/types.js"; +import { ISimulateColorBlindEffectModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Simulates the way an image would appear to someone with the specified color blind condition @@ -14,14 +14,14 @@ class SimulateColorBlindEffectAction extends Action { protected _actionModel: ISimulateColorBlindEffectModel = {}; constructor() { super(); - this._actionModel.actionType = 'simulateColorblind'; - this.addQualifier(new Qualifier('e', `simulate_colorblind`)); + this._actionModel.actionType = "simulateColorblind"; + this.addQualifier(new Qualifier("e", `simulate_colorblind`)); } - private setQualifier(val? : string) { + private setQualifier(val?: string) { const strToAppend = `:${val}`; if (val) { - this.addQualifier(new Qualifier('e', `simulate_colorblind${strToAppend}`)); + this.addQualifier(new Qualifier("e", `simulate_colorblind${strToAppend}`)); } return this; } @@ -37,7 +37,7 @@ class SimulateColorBlindEffectAction extends Action { } static fromJson(actionModel: IActionModel): SimulateColorBlindEffectAction { - const {actionType, condition} = (actionModel as ISimulateColorBlindEffectModel); + const { actionType, condition } = actionModel as ISimulateColorBlindEffectModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -48,6 +48,4 @@ class SimulateColorBlindEffectAction extends Action { } } - - -export {SimulateColorBlindEffectAction}; +export { SimulateColorBlindEffectAction }; diff --git a/src/actions/effect/StyleTransfer.ts b/src/actions/effect/StyleTransfer.ts index 15f6ab4..ba40abd 100644 --- a/src/actions/effect/StyleTransfer.ts +++ b/src/actions/effect/StyleTransfer.ts @@ -1,8 +1,7 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Action} from "../../internal/Action.js"; -import {ImageSource} from "../../qualifiers/source/sourceTypes/ImageSource.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; - +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Action } from "../../internal/Action.js"; +import { ImageSource } from "../../qualifiers/source/sourceTypes/ImageSource.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @description - This Action, while belonging to Effect, acts as a modified overlay. @@ -14,10 +13,9 @@ import {Qualifier} from "../../internal/qualifier/Qualifier.js"; */ class StyleTransfer extends Action { private imageSource: ImageSource; - private effectStrength : number; + private effectStrength: number; private preserve: boolean; - /** * The Image Source used to create the style transfer, * Use the Image Source builder to quickly create a source: @@ -30,25 +28,23 @@ class StyleTransfer extends Action { this.imageSource = imageSource; } - /** * Determines the strength in which the styleTransfer is applied. * @param {number} [effectStrength] - The strength level, 1-100, default: 100 * @return {this} */ - strength(effectStrength:number = null):this { + strength(effectStrength: number = null): this { this.effectStrength = effectStrength; return this; } - /** * More aggressively preserves the colors of the the target photo, * Can be used with `strength()` to enhance this behaviour * @param {boolean} bool * @return {this} */ - preserveColor(bool = true):this { + preserveColor(bool = true): this { this.preserve = bool; return this; } @@ -58,28 +54,22 @@ class StyleTransfer extends Action { * The result of this method is the toString() of the imageLayer provided in the constructor. * @return {string} */ - toString():string { - const NAME = 'style_transfer'; - const PRES = this.preserve ? 'preserve_color' : null; + toString(): string { + const NAME = "style_transfer"; + const PRES = this.preserve ? "preserve_color" : null; const STRENGTH = this.effectStrength; // Create the style effect - const styleEffect = new Qualifier('e', new QualifierValue([NAME, PRES, STRENGTH])); + const styleEffect = new Qualifier("e", new QualifierValue([NAME, PRES, STRENGTH])); // Handle the source for publicID, - const sourceOpenString = this.imageSource.getOpenSourceString('l'); + const sourceOpenString = this.imageSource.getOpenSourceString("l"); // Handle source transformation const imgTx = this.imageSource.getTransformation(); - const sourceTransformation = imgTx ? imgTx.toString() : ''; + const sourceTransformation = imgTx ? imgTx.toString() : ""; - return [ - sourceOpenString, - sourceTransformation, - `${styleEffect},fl_layer_apply` - ].filter((a) => a).join('/'); + return [sourceOpenString, sourceTransformation, `${styleEffect},fl_layer_apply`].filter((a) => a).join("/"); } } - - -export {StyleTransfer}; +export { StyleTransfer }; diff --git a/src/actions/effect/Theme.ts b/src/actions/effect/Theme.ts index 0cbfb71..5c62574 100644 --- a/src/actions/effect/Theme.ts +++ b/src/actions/effect/Theme.ts @@ -1,7 +1,7 @@ -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Action} from "../../internal/Action.js"; -import {SystemColors} from "../../qualifiers/color.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Action } from "../../internal/Action.js"; +import { SystemColors } from "../../qualifiers/color.js"; /** * @description Changes the main background color to the one specified, as if a 'theme change' was applied (e.g. dark mode vs light mode). @@ -12,9 +12,9 @@ import {SystemColors} from "../../qualifiers/color.js"; class ThemeEffect extends Action { private color: SystemColors; private _photosensitivity: number; - private effectName = 'theme'; + private effectName = "theme"; - constructor(color:SystemColors) { + constructor(color: SystemColors) { super(); this.color = color; } @@ -31,17 +31,14 @@ class ThemeEffect extends Action { return this; } - protected prepareQualifiers(): void { - const sensitivity = this._photosensitivity ? `:photosensitivity_${this._photosensitivity}` : ''; + const sensitivity = this._photosensitivity ? `:photosensitivity_${this._photosensitivity}` : ""; // Replace # in hex colors (#fff -> fff) - const val = `${this.effectName}:color_${this.color.replace('#', '')}${sensitivity}`; + const val = `${this.effectName}:color_${this.color.replace("#", "")}${sensitivity}`; - this.addQualifier(new Qualifier('e', new QualifierValue(val))); + this.addQualifier(new Qualifier("e", new QualifierValue(val))); return; } } - - -export {ThemeEffect}; +export { ThemeEffect }; diff --git a/src/actions/effect/Vectorize.ts b/src/actions/effect/Vectorize.ts index 28387b5..c369740 100644 --- a/src/actions/effect/Vectorize.ts +++ b/src/actions/effect/Vectorize.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {IVectorizeEffectModel} from "../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { IVectorizeEffectModel } from "../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Vectorizes the image. @@ -19,7 +19,7 @@ class VectorizeEffectAction extends Action { protected _actionModel: IVectorizeEffectModel = {}; constructor() { super(); - this._actionModel.actionType = 'vectorize'; + this._actionModel.actionType = "vectorize"; } /** @@ -49,7 +49,7 @@ class VectorizeEffectAction extends Action { * @param {number | string} num * @return {this} */ - despeckleLevel(num: number | string):this { + despeckleLevel(num: number | string): this { this._actionModel.despeckleLevel = num as number; this._despeckleLevel = num; return this; @@ -71,14 +71,14 @@ class VectorizeEffectAction extends Action { * @param {number} num * @return {this} */ - paths(num: number):this { + paths(num: number): this { this._actionModel.paths = num; this._paths = num; return this; } protected prepareQualifiers(): void { - let str = 'vectorize'; + let str = "vectorize"; if (this._numOfColors) { str += `:${new QualifierValue(`colors:${this._numOfColors}`).toString()}`; } @@ -99,11 +99,12 @@ class VectorizeEffectAction extends Action { str += `:${new QualifierValue(`corners:${this._cornersLevel}`).toString()}`; } - this.addQualifier(new Qualifier('e', str)); + this.addQualifier(new Qualifier("e", str)); } static fromJson(actionModel: IActionModel): VectorizeEffectAction { - const {actionType, paths, cornersLevel, despeckleLevel, detailLevel, numOfColors} = (actionModel as IVectorizeEffectModel); + const { actionType, paths, cornersLevel, despeckleLevel, detailLevel, numOfColors } = + actionModel as IVectorizeEffectModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -116,8 +117,6 @@ class VectorizeEffectAction extends Action { return result; } - } - -export {VectorizeEffectAction}; +export { VectorizeEffectAction }; diff --git a/src/actions/effect/blur/Blur.ts b/src/actions/effect/blur/Blur.ts index 6fe28a2..dca985d 100644 --- a/src/actions/effect/blur/Blur.ts +++ b/src/actions/effect/blur/Blur.ts @@ -1,9 +1,9 @@ -import {NamedRegion} from "../../../qualifiers/region/NamedRegion.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {Action} from "../../../internal/Action.js"; -import {IBlurModel} from "../../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; -import {custom, faces} from "../../../qualifiers/region.js"; +import { NamedRegion } from "../../../qualifiers/region/NamedRegion.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { Action } from "../../../internal/Action.js"; +import { IBlurModel } from "../../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; +import { custom, faces } from "../../../qualifiers/region.js"; /** * @description The Action class of the blur Builder. @@ -19,7 +19,7 @@ class BlurAction extends Action { constructor(strength: number | string) { super(); this._strength = strength; - this._actionModel.actionType = 'blur'; + this._actionModel.actionType = "blur"; this._actionModel.strength = strength as number; } @@ -28,7 +28,7 @@ class BlurAction extends Action { * @param {NamedRegion} blurRegion */ region(blurRegion: NamedRegion): this { - this._actionModel.region = {RegionType: blurRegion.regionType}; + this._actionModel.region = { RegionType: blurRegion.regionType }; this._region = blurRegion; return this; } @@ -43,7 +43,7 @@ class BlurAction extends Action { return this; } - protected prepareQualifiers():void { + protected prepareQualifiers(): void { /* * Blur with region is a unique object in this codebase. * On top of Blur being an Action with Qualifiers, @@ -63,41 +63,41 @@ class BlurAction extends Action { * We're not using the full Gravity Qualifier here to prevent the code import for such a simplistic case */ - const str = this._strength ? `:${this._strength}` : ''; - if ('_region' in this) { + const str = this._strength ? `:${this._strength}` : ""; + if ("_region" in this) { const qualifiers = this._region.qualifiers; // Copy qualifiers from the region "action" to the blur action qualifiers.forEach((q) => this.addQualifier(q)); - if (this._region.regionType === 'named') { - this.addQualifier(new Qualifier('e', `blur_region${str}`)); + if (this._region.regionType === "named") { + this.addQualifier(new Qualifier("e", `blur_region${str}`)); } - if (this._region.regionType === 'ocr_text') { - this.addQualifier(new Qualifier('e', `blur_region${str}`)); - this.addQualifier(new Qualifier('g', `ocr_text`)); + if (this._region.regionType === "ocr_text") { + this.addQualifier(new Qualifier("e", `blur_region${str}`)); + this.addQualifier(new Qualifier("g", `ocr_text`)); } - if (this._region.regionType === 'faces') { - this.addQualifier(new Qualifier('e', `blur_faces${str}`)); + if (this._region.regionType === "faces") { + this.addQualifier(new Qualifier("e", `blur_faces${str}`)); } } else { - this.addQualifier(new Qualifier('e', `blur${str}`)); + this.addQualifier(new Qualifier("e", `blur${str}`)); } } static fromJson(actionModel: IActionModel): BlurAction { - const {actionType, strength, region} = (actionModel as IBlurModel); + const { actionType, strength, region } = actionModel as IBlurModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(strength); strength && result.strength(strength); - if(region && region.RegionType === 'faces'){ + if (region && region.RegionType === "faces") { result.region(faces()); } - if(region && region.RegionType === 'custom'){ + if (region && region.RegionType === "custom") { result.region(custom()); } @@ -105,5 +105,4 @@ class BlurAction extends Action { } } - -export {BlurAction}; +export { BlurAction }; diff --git a/src/actions/effect/leveled/Accelerate.ts b/src/actions/effect/leveled/Accelerate.ts index 803da26..926942b 100644 --- a/src/actions/effect/leveled/Accelerate.ts +++ b/src/actions/effect/leveled/Accelerate.ts @@ -1,10 +1,8 @@ -import {Action} from "../../../internal/Action.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../../internal/qualifier/QualifierValue.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; -import { - IAccelerateActionModel -} from "../../../internal/models/IEffectActionModel.js"; +import { Action } from "../../../internal/Action.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../../internal/qualifier/QualifierValue.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; +import { IAccelerateActionModel } from "../../../internal/models/IEffectActionModel.js"; /** * @description Changes the speed of the video playback using the rate() method @@ -13,7 +11,7 @@ import { */ class AccelerationEffectAction extends Action { private _rate: string | number; - protected _actionModel: IAccelerateActionModel = {actionType: 'accelerate'}; + protected _actionModel: IAccelerateActionModel = { actionType: "accelerate" }; constructor(rate?: string | number) { super(); @@ -28,13 +26,13 @@ class AccelerationEffectAction extends Action { } protected prepareQualifiers(): this { - const qualifierValue = new QualifierValue(['accelerate', this._rate]).setDelimiter(':'); - this.addQualifier(new Qualifier('e', qualifierValue)); + const qualifierValue = new QualifierValue(["accelerate", this._rate]).setDelimiter(":"); + this.addQualifier(new Qualifier("e", qualifierValue)); return this; } static fromJson(actionModel: IActionModel): AccelerationEffectAction { - const {rate} = (actionModel as IAccelerateActionModel); + const { rate } = actionModel as IAccelerateActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created // @ts-ignore @@ -45,5 +43,4 @@ class AccelerationEffectAction extends Action { } } - -export {AccelerationEffectAction}; +export { AccelerationEffectAction }; diff --git a/src/actions/effect/leveled/Blackwhite.ts b/src/actions/effect/leveled/Blackwhite.ts index 43e6e99..6b4a0ad 100644 --- a/src/actions/effect/leveled/Blackwhite.ts +++ b/src/actions/effect/leveled/Blackwhite.ts @@ -1,4 +1,4 @@ -import {LeveledEffectAction} from "../EffectActions/LeveledEffectAction.js"; +import { LeveledEffectAction } from "../EffectActions/LeveledEffectAction.js"; /** * @description Converts the image to black and white. @@ -12,5 +12,4 @@ class BlackwhiteEffectAction extends LeveledEffectAction { } } - -export {BlackwhiteEffectAction}; +export { BlackwhiteEffectAction }; diff --git a/src/actions/effect/leveled/Deshake.ts b/src/actions/effect/leveled/Deshake.ts index ebb8404..6a40cae 100644 --- a/src/actions/effect/leveled/Deshake.ts +++ b/src/actions/effect/leveled/Deshake.ts @@ -1,7 +1,7 @@ -import {LeveledEffectAction} from "../EffectActions/LeveledEffectAction.js"; -import {ExpressionQualifier} from "../../../qualifiers/expression/ExpressionQualifier.js"; -import {IDeshakeEffectModel} from "../../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; +import { LeveledEffectAction } from "../EffectActions/LeveledEffectAction.js"; +import { ExpressionQualifier } from "../../../qualifiers/expression/ExpressionQualifier.js"; +import { IDeshakeEffectModel } from "../../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; type pixels = 16 | 32 | 48 | 64; /** @@ -11,7 +11,7 @@ type pixels = 16 | 32 | 48 | 64; * @see Visit {@link Actions.Effect|Effect} for an example */ class DeshakeEffectAction extends LeveledEffectAction { - protected _actionModel: IDeshakeEffectModel = {actionType: 'deshake'}; + protected _actionModel: IDeshakeEffectModel = { actionType: "deshake" }; /** * The maximum number of pixels in the horizontal and vertical direction that will be addressed. (Possible values: 16, 32, 48, 64. Server default: 16) * @param value Possible values: 16, 32, 48, 64. Server default: 16. @@ -24,7 +24,7 @@ class DeshakeEffectAction extends LeveledEffectAction { } static fromJson(actionModel: IActionModel): DeshakeEffectAction { - const {actionType, pixels} = (actionModel as IDeshakeEffectModel); + const { actionType, pixels } = actionModel as IDeshakeEffectModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -34,6 +34,4 @@ class DeshakeEffectAction extends LeveledEffectAction { } } - - -export {DeshakeEffectAction}; +export { DeshakeEffectAction }; diff --git a/src/actions/effect/leveled/FadeIn.ts b/src/actions/effect/leveled/FadeIn.ts index f25544e..407c4c7 100644 --- a/src/actions/effect/leveled/FadeIn.ts +++ b/src/actions/effect/leveled/FadeIn.ts @@ -1,9 +1,8 @@ -import {Action} from "../../../internal/Action.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../../internal/qualifier/QualifierValue.js"; -import {IFadeInEffectActionModel} from "../../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; - +import { Action } from "../../../internal/Action.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../../internal/qualifier/QualifierValue.js"; +import { IFadeInEffectActionModel } from "../../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; /** * @description Fade out at the end of the video, use the length() method to set the time in ms for the fade to occur. (Server default: 2000) @@ -11,11 +10,11 @@ import {IActionModel} from "../../../internal/models/IActionModel.js"; * @memberOf Actions.Effect * @see Visit {@link Actions.Effect|Effect} for an example */ -class FadeInEffectAction extends Action{ - protected _actionModel : IFadeInEffectActionModel = {actionType: 'fadeIn'}; +class FadeInEffectAction extends Action { + protected _actionModel: IFadeInEffectActionModel = { actionType: "fadeIn" }; constructor(duration?: number) { super(); - this.addQualifier(new Qualifier('e', new QualifierValue(['fade', `${duration}`]).setDelimiter(':'))); + this.addQualifier(new Qualifier("e", new QualifierValue(["fade", `${duration}`]).setDelimiter(":"))); duration && (this._actionModel.length = duration); } @@ -26,11 +25,11 @@ class FadeInEffectAction extends Action{ */ duration(duration: number | string): this { this._actionModel.length = duration as number; - return this.addQualifier(new Qualifier('e', new QualifierValue(['fade', `${duration}`]).setDelimiter(':'))); + return this.addQualifier(new Qualifier("e", new QualifierValue(["fade", `${duration}`]).setDelimiter(":"))); } static fromJson(actionModel: IActionModel): FadeInEffectAction { - const {length} = (actionModel as IFadeInEffectActionModel); + const { length } = actionModel as IFadeInEffectActionModel; if (length === undefined) { return new this(1000); @@ -44,5 +43,4 @@ class FadeInEffectAction extends Action{ } } - -export {FadeInEffectAction}; +export { FadeInEffectAction }; diff --git a/src/actions/effect/leveled/FadeOut.ts b/src/actions/effect/leveled/FadeOut.ts index 6858270..e672aeb 100644 --- a/src/actions/effect/leveled/FadeOut.ts +++ b/src/actions/effect/leveled/FadeOut.ts @@ -1,10 +1,9 @@ -import {LeveledEffectAction} from "../EffectActions/LeveledEffectAction.js"; -import {Action} from "../../../internal/Action.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../../internal/qualifier/QualifierValue.js"; -import {IFadeOutEffectActionModel} from "../../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; - +import { LeveledEffectAction } from "../EffectActions/LeveledEffectAction.js"; +import { Action } from "../../../internal/Action.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../../internal/qualifier/QualifierValue.js"; +import { IFadeOutEffectActionModel } from "../../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; /** * @description Fade out at the end of the video, use the length() method to set the time in ms for the fade to occur. (Server default: 2000) @@ -13,10 +12,10 @@ import {IActionModel} from "../../../internal/models/IActionModel.js"; * @see Visit {@link Actions.Effect|Effect} for an example */ class FadeOutEffectAction extends Action { - protected _actionModel : IFadeOutEffectActionModel = {actionType: 'fadeOut'}; + protected _actionModel: IFadeOutEffectActionModel = { actionType: "fadeOut" }; constructor(duration: number) { super(); - this.addQualifier(new Qualifier('e', new QualifierValue(['fade', `-${duration}`]).setDelimiter(':'))); + this.addQualifier(new Qualifier("e", new QualifierValue(["fade", `-${duration}`]).setDelimiter(":"))); duration && (this._actionModel.length = duration); } /** @@ -26,11 +25,11 @@ class FadeOutEffectAction extends Action { */ duration(duration: number | string): this { this._actionModel.length = duration as number; - return this.addQualifier(new Qualifier('e', new QualifierValue(['fade', `-${duration}`]).setDelimiter(':'))); + return this.addQualifier(new Qualifier("e", new QualifierValue(["fade", `-${duration}`]).setDelimiter(":"))); } static fromJson(actionModel: IActionModel): FadeOutEffectAction { - const {length} = (actionModel as IFadeOutEffectActionModel); + const { length } = actionModel as IFadeOutEffectActionModel; if (length === undefined) { return new this(1000); @@ -44,5 +43,4 @@ class FadeOutEffectAction extends Action { } } - -export {FadeOutEffectAction}; +export { FadeOutEffectAction }; diff --git a/src/actions/effect/leveled/Loop.ts b/src/actions/effect/leveled/Loop.ts index 40d9109..8ee1be2 100644 --- a/src/actions/effect/leveled/Loop.ts +++ b/src/actions/effect/leveled/Loop.ts @@ -1,5 +1,5 @@ -import {LeveledEffectAction} from "../EffectActions/LeveledEffectAction.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; +import { LeveledEffectAction } from "../EffectActions/LeveledEffectAction.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; /** * @description Delivers a video or animated GIF that contains additional loops of the video/GIF. @@ -16,7 +16,7 @@ class LoopEffectAction extends LeveledEffectAction { } static fromJson(actionModel: IActionModel): LoopEffectAction { - const {actionType, iterations } = (actionModel); + const { actionType, iterations } = actionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -26,5 +26,4 @@ class LoopEffectAction extends LeveledEffectAction { } } - -export {LoopEffectAction}; +export { LoopEffectAction }; diff --git a/src/actions/effect/leveled/MakeTransparent.ts b/src/actions/effect/leveled/MakeTransparent.ts index 3ea9cb6..263254b 100644 --- a/src/actions/effect/leveled/MakeTransparent.ts +++ b/src/actions/effect/leveled/MakeTransparent.ts @@ -1,11 +1,11 @@ -import {LeveledEffectAction} from "../EffectActions/LeveledEffectAction.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../../internal/qualifier/QualifierValue.js"; -import {prepareColor} from "../../../internal/utils/prepareColor.js"; -import {SystemColors} from "../../../qualifiers/color.js"; -import {IMakeTransparentEffectModel} from "../../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; -import {ACTION_TYPE_TO_EFFECT_MODE_MAP} from "../../../internal/internalConstants.js"; +import { LeveledEffectAction } from "../EffectActions/LeveledEffectAction.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../../internal/qualifier/QualifierValue.js"; +import { prepareColor } from "../../../internal/utils/prepareColor.js"; +import { SystemColors } from "../../../qualifiers/color.js"; +import { IMakeTransparentEffectModel } from "../../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; +import { ACTION_TYPE_TO_EFFECT_MODE_MAP } from "../../../internal/internalConstants.js"; /** * @description Makes the background of the image transparent (or solid white for formats that do not support transparency). @@ -14,7 +14,9 @@ import {ACTION_TYPE_TO_EFFECT_MODE_MAP} from "../../../internal/internalConstant * @see Visit {@link Actions.Effect|Effect} for an example */ class MakeTransparentEffectAction extends LeveledEffectAction { - protected _actionModel: IMakeTransparentEffectModel = {actionType: 'makeTransparent'}; + protected _actionModel: IMakeTransparentEffectModel = { + actionType: "makeTransparent", + }; /** * @description Sets the tolerance used to accommodate variance in the background color. * @param {number | string} value The tolerance used to accommodate variance in the background color. (Range: 0 to 100, Server default: 10) @@ -33,11 +35,11 @@ class MakeTransparentEffectAction extends LeveledEffectAction { */ colorToReplace(color: SystemColors): this { this._actionModel.color = color; - return this.addQualifier(new Qualifier('co', new QualifierValue(prepareColor(color)))); + return this.addQualifier(new Qualifier("co", new QualifierValue(prepareColor(color)))); } static fromJson(actionModel: IActionModel): MakeTransparentEffectAction { - const {actionType, tolerance, color } = (actionModel as IMakeTransparentEffectModel); + const { actionType, tolerance, color } = actionModel as IMakeTransparentEffectModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -49,5 +51,4 @@ class MakeTransparentEffectAction extends LeveledEffectAction { } } - -export {MakeTransparentEffectAction}; +export { MakeTransparentEffectAction }; diff --git a/src/actions/effect/pixelate/Pixelate.ts b/src/actions/effect/pixelate/Pixelate.ts index 48f7712..4107e51 100644 --- a/src/actions/effect/pixelate/Pixelate.ts +++ b/src/actions/effect/pixelate/Pixelate.ts @@ -1,9 +1,9 @@ -import {NamedRegion} from "../../../qualifiers/region/NamedRegion.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {Action} from "../../../internal/Action.js"; -import {IPixelateModel} from "../../../internal/models/IEffectActionModel.js"; -import {IActionModel} from "../../../internal/models/IActionModel.js"; -import {custom, faces} from "../../../qualifiers/region.js"; +import { NamedRegion } from "../../../qualifiers/region/NamedRegion.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { Action } from "../../../internal/Action.js"; +import { IPixelateModel } from "../../../internal/models/IEffectActionModel.js"; +import { IActionModel } from "../../../internal/models/IActionModel.js"; +import { custom, faces } from "../../../qualifiers/region.js"; /** * @description The Action class of the pixelate Builder @@ -19,7 +19,7 @@ class Pixelate extends Action { constructor(squareSize: number | string) { super(); this._squareSize = squareSize; - this._actionModel.actionType = 'pixelate'; + this._actionModel.actionType = "pixelate"; this._actionModel.squareSize = squareSize as number; } @@ -29,7 +29,7 @@ class Pixelate extends Action { */ region(pixelateRegion: NamedRegion): this { this._region = pixelateRegion; - this._actionModel.region = {RegionType: this._region.regionType}; + this._actionModel.region = { RegionType: this._region.regionType }; return this; } @@ -63,42 +63,42 @@ class Pixelate extends Action { * We're not using the full Gravity Qualifier here to prevent the code import for such a simplistic case */ - const str = this._squareSize ? `:${this._squareSize}` : ''; - if ('_region' in this) { + const str = this._squareSize ? `:${this._squareSize}` : ""; + if ("_region" in this) { const qualifiers = this._region.qualifiers; // Copy qualifiers from the region "action" to the pixelate action qualifiers.forEach((q) => this.addQualifier(q)); - if (this._region.regionType === 'named') { - this.addQualifier(new Qualifier('e', `pixelate_region${str}`)); + if (this._region.regionType === "named") { + this.addQualifier(new Qualifier("e", `pixelate_region${str}`)); } - if (this._region.regionType === 'ocr_text') { - this.addQualifier(new Qualifier('e', `pixelate_region${str}`)); - this.addQualifier(new Qualifier('g', `ocr_text`)); + if (this._region.regionType === "ocr_text") { + this.addQualifier(new Qualifier("e", `pixelate_region${str}`)); + this.addQualifier(new Qualifier("g", `ocr_text`)); } - if (this._region.regionType === 'faces') { - this.addQualifier(new Qualifier('e', `pixelate_faces${str}`)); + if (this._region.regionType === "faces") { + this.addQualifier(new Qualifier("e", `pixelate_faces${str}`)); } } else { - this.addQualifier(new Qualifier('e', `pixelate${str}`)); + this.addQualifier(new Qualifier("e", `pixelate${str}`)); } } static fromJson(actionModel: IActionModel): Pixelate { - const {actionType, region, squareSize } = (actionModel as IPixelateModel); + const { actionType, region, squareSize } = actionModel as IPixelateModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(squareSize); squareSize && result.squareSize(squareSize); - if(region && region.RegionType === 'faces'){ + if (region && region.RegionType === "faces") { result.region(faces()); } - if(region && region.RegionType === 'custom'){ + if (region && region.RegionType === "custom") { result.region(custom()); } @@ -106,5 +106,4 @@ class Pixelate extends Action { } } - -export {Pixelate}; +export { Pixelate }; diff --git a/src/actions/extract.ts b/src/actions/extract.ts index a7c23f6..a3b178b 100644 --- a/src/actions/extract.ts +++ b/src/actions/extract.ts @@ -1,6 +1,6 @@ -import {QualifierValue} from "../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../internal/qualifier/Qualifier.js"; -import {Action} from "../internal/Action.js"; +import { QualifierValue } from "../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../internal/qualifier/Qualifier.js"; +import { Action } from "../internal/Action.js"; /** * @description Extracts an image or a page using an index, a range, or a name from a layered media asset. @@ -28,7 +28,6 @@ import {Action} from "../internal/Action.js"; * */ - /** * @description Extracts an image or a page using an index, a range, or a name from a layered media asset. * @extends SDK.Action @@ -40,14 +39,14 @@ class ExtractAction extends Action { constructor() { super(); - this.qualifierValue.delimiter = ';'; + this.qualifierValue.delimiter = ";"; } /** * @description Extract an image containing only specified layer of an asset * @param {string|number} from The layer number */ - byNumber(from: string|number): this{ + byNumber(from: string | number): this { this.qualifierValue.addValue(from); return this; } @@ -57,22 +56,21 @@ class ExtractAction extends Action { * @param {string|number} from The layer number * @param {string|number} to The layer number */ - byRange(from: string|number, to: string|number): this{ + byRange(from: string | number, to: string | number): this { const range = new QualifierValue(from); range.addValue(to); - range.delimiter = '-'; + range.delimiter = "-"; this.qualifierValue.addValue(range); return this; } protected prepareQualifiers(): this { - this.addQualifier(new Qualifier('pg', this.qualifierValue)); + this.addQualifier(new Qualifier("pg", this.qualifierValue)); return this; } } - /** * @summary action * @description Extracts an image containing only specified layers of a Photoshop image. @@ -95,7 +93,9 @@ function getPage(): ExtractAction { } const Extract = { - getFrame, getPage, ExtractAction + getFrame, + getPage, + ExtractAction, }; -export {getFrame, getPage, ExtractAction, Extract}; +export { getFrame, getPage, ExtractAction, Extract }; diff --git a/src/actions/layer/LayerAction.ts b/src/actions/layer/LayerAction.ts index 035fb3b..b037e0c 100644 --- a/src/actions/layer/LayerAction.ts +++ b/src/actions/layer/LayerAction.ts @@ -1,24 +1,23 @@ -import {Action} from "../../internal/Action.js"; -import {TimelinePosition} from "../../qualifiers/video/TimelinePosition.js"; -import {BlendModeQualifier} from "../../qualifiers/blendMode/BlendModeQualifier.js"; -import {PositionQualifier} from "../../qualifiers/position/PositionQualifier.js"; -import {FlagQualifier} from "../../qualifiers/flag/FlagQualifier.js"; -import {Position} from "../../qualifiers/position.js"; -import {BaseSource} from "../../qualifiers/source/BaseSource.js"; -import {BlendModeType} from "../../types/types.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {IOverlayActionModel} from "../../internal/models/IOverlayActionModel.js"; -import {createSourceFromModel} from "../../internal/models/createSourceFromModel.js"; -import {ImageSource} from "../../qualifiers/source/sourceTypes/ImageSource.js"; -import {ITransformationFromJson} from "../../internal/models/IHasFromJson.js"; -import {createPositionFromModel} from "../../internal/models/createPositionFromModel.js"; -import {createTimelinePositionFromModel} from "../../internal/models/createTimelinePositionFromModel.js"; -import {ISourceModel} from "../../internal/models/ISourceModel.js"; -import {ITimelinePositionModel} from "../../internal/models/ITimelinePositionModel.js"; -import {IPositionModel} from "../../internal/models/IPositionModel.js"; -import {ACTION_TYPE_TO_BLEND_MODE_MAP} from "../../internal/internalConstants.js"; - +import { Action } from "../../internal/Action.js"; +import { TimelinePosition } from "../../qualifiers/video/TimelinePosition.js"; +import { BlendModeQualifier } from "../../qualifiers/blendMode/BlendModeQualifier.js"; +import { PositionQualifier } from "../../qualifiers/position/PositionQualifier.js"; +import { FlagQualifier } from "../../qualifiers/flag/FlagQualifier.js"; +import { Position } from "../../qualifiers/position.js"; +import { BaseSource } from "../../qualifiers/source/BaseSource.js"; +import { BlendModeType } from "../../types/types.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { IOverlayActionModel } from "../../internal/models/IOverlayActionModel.js"; +import { createSourceFromModel } from "../../internal/models/createSourceFromModel.js"; +import { ImageSource } from "../../qualifiers/source/sourceTypes/ImageSource.js"; +import { ITransformationFromJson } from "../../internal/models/IHasFromJson.js"; +import { createPositionFromModel } from "../../internal/models/createPositionFromModel.js"; +import { createTimelinePositionFromModel } from "../../internal/models/createTimelinePositionFromModel.js"; +import { ISourceModel } from "../../internal/models/ISourceModel.js"; +import { ITimelinePositionModel } from "../../internal/models/ITimelinePositionModel.js"; +import { IPositionModel } from "../../internal/models/IPositionModel.js"; +import { ACTION_TYPE_TO_BLEND_MODE_MAP } from "../../internal/internalConstants.js"; /** * @extends SDK.Action @@ -29,11 +28,11 @@ import {ACTION_TYPE_TO_BLEND_MODE_MAP} from "../../internal/internalConstants.js */ class LayerAction extends Action { private source: BaseSource; - private _position:PositionQualifier; + private _position: PositionQualifier; private _blendMode: BlendModeQualifier | BlendModeType; private _timelinePosition: TimelinePosition; protected _actionModel: IOverlayActionModel; - layerType: 'u' | 'l'; + layerType: "u" | "l"; /** * @description Creates a LayerAction to be used with overlays and underlays @@ -44,8 +43,8 @@ class LayerAction extends Action { this.source = layerSource; this._actionModel = { - actionType: 'overlay', - source: layerSource.toJson() as ISourceModel + actionType: "overlay", + source: layerSource.toJson() as ISourceModel, }; } @@ -54,9 +53,9 @@ class LayerAction extends Action { * @param {'u' | 'l'} type * @return {this} */ - setLayerType(type: 'u' | 'l'): this { + setLayerType(type: "u" | "l"): this { this.layerType = type; - this._actionModel.actionType = type === 'u' ? 'underlay' : 'overlay'; + this._actionModel.actionType = type === "u" ? "underlay" : "overlay"; return this; } @@ -90,14 +89,16 @@ class LayerAction extends Action { * @param {Qualifiers.BlendMode|BlendModeType} blendMode * @return {this} */ - blendMode(blendMode: BlendModeType|BlendModeQualifier): this { + blendMode(blendMode: BlendModeType | BlendModeQualifier): this { this._blendMode = blendMode; - const [mode, level] = `${blendMode}`.replace('e_', '').split(":"); - if (mode === 'anti_removal') { - this._actionModel.blendMode = level ? {blendModeType: 'antiRemoval', level: level} : {blendModeType: 'antiRemoval'}; - }else { - this._actionModel.blendMode = {blendModeType: mode}; + const [mode, level] = `${blendMode}`.replace("e_", "").split(":"); + if (mode === "anti_removal") { + this._actionModel.blendMode = level + ? { blendModeType: "antiRemoval", level: level } + : { blendModeType: "antiRemoval" }; + } else { + this._actionModel.blendMode = { blendModeType: mode }; } return this; } @@ -108,8 +109,8 @@ class LayerAction extends Action { * Closes a layer (layers are built in three stages -> /Open/Transform/Close). * @return {SDK.Action} */ - private closeLayer():Action { - const bit = new Action().addFlag(new FlagQualifier('layer_apply')); + private closeLayer(): Action { + const bit = new Action().addFlag(new FlagQualifier("layer_apply")); this._position?.qualifiers.forEach((qualifier) => { bit.addQualifier(qualifier); @@ -120,9 +121,9 @@ class LayerAction extends Action { bit.addFlag(flag); }); - if(typeof this._blendMode === "string"){ - bit.addQualifier(new Qualifier('e', this._blendMode)); - }else{ + if (typeof this._blendMode === "string") { + bit.addQualifier(new Qualifier("e", this._blendMode)); + } else { this._blendMode?.qualifiers.forEach((qualifier) => { bit.addQualifier(qualifier); }); @@ -144,28 +145,29 @@ class LayerAction extends Action { return `${this.source.getOpenSourceString(this.layerType)}`; } - /** * @description * Serializes the Layer to a string * @return {string} */ - toString():string{ + toString(): string { return [ this.openLayer(), this.source.getTransformation() && this.source.getTransformation().toString(), - this.closeLayer() - ].filter((a) => a).join('/'); + this.closeLayer(), + ] + .filter((a) => a) + .join("/"); } static fromJson(actionModel: IActionModel, transformationFromJson: ITransformationFromJson): LayerAction { - const {source, actionType, position, timelinePosition, blendMode} = (actionModel as IOverlayActionModel); + const { source, actionType, position, timelinePosition, blendMode } = actionModel as IOverlayActionModel; const sourceInstance = createSourceFromModel(source, transformationFromJson) as ImageSource; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(sourceInstance); - const layerType = actionType === 'overlay' ? 'l' : 'u'; + const layerType = actionType === "overlay" ? "l" : "u"; result.setLayerType(layerType); if (position) { @@ -178,9 +180,9 @@ class LayerAction extends Action { if (blendMode) { const blendModeType = ACTION_TYPE_TO_BLEND_MODE_MAP[blendMode.blendModeType] || blendMode.blendModeType; - if(blendMode?.level) { + if (blendMode?.level) { result.blendMode(new BlendModeQualifier(blendModeType, blendMode.level as number)); - }else{ + } else { result.blendMode(new BlendModeQualifier(blendModeType)); } } @@ -189,4 +191,4 @@ class LayerAction extends Action { } } -export {LayerAction}; +export { LayerAction }; diff --git a/src/actions/namedTransformation.ts b/src/actions/namedTransformation.ts index ba279ac..e253e3d 100644 --- a/src/actions/namedTransformation.ts +++ b/src/actions/namedTransformation.ts @@ -1,4 +1,4 @@ -import {NamedTransformationAction} from "./namedTransformation/NamedTransformationAction.js"; +import { NamedTransformationAction } from "./namedTransformation/NamedTransformationAction.js"; /** * Applies a pre-defined named transformation of the given name. @@ -22,11 +22,10 @@ import {NamedTransformationAction} from "./namedTransformation/NamedTransformati * @memberOf Actions.NamedTransformation * @return {Actions.NamedTransformation.NamedTransformationAction} */ -function name(name:string): NamedTransformationAction { +function name(name: string): NamedTransformationAction { return new NamedTransformationAction(name); } +const NamedTransformation = { name }; -const NamedTransformation = {name}; - -export {NamedTransformation, name}; +export { NamedTransformation, name }; diff --git a/src/actions/namedTransformation/NamedTransformationAction.ts b/src/actions/namedTransformation/NamedTransformationAction.ts index 97db98d..fb7ac00 100644 --- a/src/actions/namedTransformation/NamedTransformationAction.ts +++ b/src/actions/namedTransformation/NamedTransformationAction.ts @@ -1,5 +1,5 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @description Applies a pre-defined named transformation of the given name, used with a builder from {@link Actions.NamedTransformation|Named Transformation} @@ -12,10 +12,10 @@ class NamedTransformationAction extends Action { * * @param {string} name The name of the named transformation */ - constructor(name:string) { + constructor(name: string) { super(); - this.addQualifier(new Qualifier('t', name)); + this.addQualifier(new Qualifier("t", name)); } } -export {NamedTransformationAction}; +export { NamedTransformationAction }; diff --git a/src/actions/overlay.ts b/src/actions/overlay.ts index bb7667c..b8c58f5 100644 --- a/src/actions/overlay.ts +++ b/src/actions/overlay.ts @@ -1,5 +1,5 @@ -import {BaseSource} from "../qualifiers/source/BaseSource.js"; -import {LayerAction} from "./layer/LayerAction.js"; +import { BaseSource } from "../qualifiers/source/BaseSource.js"; +import { LayerAction } from "./layer/LayerAction.js"; /** * @description Adds a video, text or an image layer as an overlay over the base layer.
      @@ -35,7 +35,6 @@ import {LayerAction} from "./layer/LayerAction.js"; * ) */ - /** * @summary action * @memberOf Actions.Overlay @@ -45,9 +44,8 @@ import {LayerAction} from "./layer/LayerAction.js"; * @return {SDK.LayerAction} */ function source(source: BaseSource): LayerAction { - return new LayerAction(source) - .setLayerType('l'); + return new LayerAction(source).setLayerType("l"); } -const Overlay = {source}; -export {Overlay, source}; +const Overlay = { source }; +export { Overlay, source }; diff --git a/src/actions/psdTools.ts b/src/actions/psdTools.ts index d495016..bbade3f 100644 --- a/src/actions/psdTools.ts +++ b/src/actions/psdTools.ts @@ -1,6 +1,6 @@ -import {ClipAction} from "./psdTools/ClipAction.js"; -import {GetLayerAction} from "./psdTools/GetLayerAction.js"; -import {SmartObjectAction} from "./psdTools/SmartObjectAction.js"; +import { ClipAction } from "./psdTools/ClipAction.js"; +import { GetLayerAction } from "./psdTools/GetLayerAction.js"; +import { SmartObjectAction } from "./psdTools/SmartObjectAction.js"; /** * @namespace PSDTools @@ -11,7 +11,6 @@ import {SmartObjectAction} from "./psdTools/SmartObjectAction.js"; * // See examples under each method */ - /** * @summary action * @description Trims the pixels of a PSD image according to a Photoshop clipping path that is stored in the image's metadata. @@ -82,6 +81,5 @@ function smartObject(): SmartObjectAction { return new SmartObjectAction(); } - -const PSDTools = {clip, getLayer, smartObject}; -export {PSDTools, clip, getLayer, smartObject}; +const PSDTools = { clip, getLayer, smartObject }; +export { PSDTools, clip, getLayer, smartObject }; diff --git a/src/actions/psdTools/ClipAction.ts b/src/actions/psdTools/ClipAction.ts index 16352a6..267615b 100644 --- a/src/actions/psdTools/ClipAction.ts +++ b/src/actions/psdTools/ClipAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {clip, clipEvenOdd} from "../../qualifiers/flag.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { clip, clipEvenOdd } from "../../qualifiers/flag.js"; /** * @description Defines the clipping path to use when trimming pixels. @@ -14,7 +14,6 @@ class ClipAction extends Action { private isEvenOdd = false; constructor() { super(); - } /** @@ -48,21 +47,21 @@ class ClipAction extends Action { protected prepareQualifiers(): this { let qualifierValue; - if(typeof this.path === 'string') { - qualifierValue = new QualifierValue(['name', this.path]).setDelimiter(':'); + if (typeof this.path === "string") { + qualifierValue = new QualifierValue(["name", this.path]).setDelimiter(":"); } else { qualifierValue = new QualifierValue(this.path); } //handles flag - if(this.isEvenOdd){ + if (this.isEvenOdd) { this.addFlag(clipEvenOdd()); - }else { + } else { this.addFlag(clip()); } - this.addQualifier(new Qualifier('pg', qualifierValue)); + this.addQualifier(new Qualifier("pg", qualifierValue)); return this; } } -export {ClipAction}; +export { ClipAction }; diff --git a/src/actions/psdTools/GetLayerAction.ts b/src/actions/psdTools/GetLayerAction.ts index 4e393b1..e0388c2 100644 --- a/src/actions/psdTools/GetLayerAction.ts +++ b/src/actions/psdTools/GetLayerAction.ts @@ -1,6 +1,6 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @description Represents a layer in a Photoshop document. @@ -15,14 +15,14 @@ class GetLayerAction extends Action { constructor() { super(); - this.qualifierValue.delimiter = ';'; + this.qualifierValue.delimiter = ";"; } /** * @description deliver an image containing only specified layer of a Photoshop image from The layer index * @param {string|number} from the index of the layer */ - byIndex(from: string|number): this{ + byIndex(from: string | number): this { this.qualifierValue.addValue(from); return this; } @@ -32,10 +32,10 @@ class GetLayerAction extends Action { * @param {string|number} from The layer number * @param {string|number} to The layer number */ - byRange(from: string|number, to: string|number): this{ + byRange(from: string | number, to: string | number): this { const range = new QualifierValue(from); range.addValue(to); - range.delimiter = '-'; + range.delimiter = "-"; this.qualifierValue.addValue(range); return this; @@ -45,7 +45,7 @@ class GetLayerAction extends Action { * @description deliver an image containing only specified layer by name of a Photoshop image * @param {string|number} name The layer by name */ - byName(name: string): this{ + byName(name: string): this { this.name = name; this.qualifierValue.addValue(name); return this; @@ -53,13 +53,13 @@ class GetLayerAction extends Action { protected prepareQualifiers(): this { let qualifierValue = this.qualifierValue; - if(this.name) { - qualifierValue = new QualifierValue(['name', this.qualifierValue]).setDelimiter(':'); + if (this.name) { + qualifierValue = new QualifierValue(["name", this.qualifierValue]).setDelimiter(":"); } - this.addQualifier(new Qualifier('pg', qualifierValue)); + this.addQualifier(new Qualifier("pg", qualifierValue)); return this; } } -export {GetLayerAction}; +export { GetLayerAction }; diff --git a/src/actions/psdTools/SmartObjectAction.ts b/src/actions/psdTools/SmartObjectAction.ts index c7c60d2..f08d90d 100644 --- a/src/actions/psdTools/SmartObjectAction.ts +++ b/src/actions/psdTools/SmartObjectAction.ts @@ -1,6 +1,6 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @description Represents an embedded smart object in a Photoshop document. @@ -16,7 +16,7 @@ class SmartObjectAction extends Action { constructor() { super(); - this.qualifierValue.delimiter = ';'; + this.qualifierValue.delimiter = ";"; } /** @@ -42,13 +42,13 @@ class SmartObjectAction extends Action { protected prepareQualifiers(): void { let qualifierValue; if (this.useName) { - qualifierValue = new QualifierValue(['embedded:name', this.qualifierValue]); + qualifierValue = new QualifierValue(["embedded:name", this.qualifierValue]); } else { - qualifierValue = new QualifierValue(['embedded', this.qualifierValue]); + qualifierValue = new QualifierValue(["embedded", this.qualifierValue]); } - this.addQualifier(new Qualifier('pg', qualifierValue)); + this.addQualifier(new Qualifier("pg", qualifierValue)); } } -export {SmartObjectAction}; +export { SmartObjectAction }; diff --git a/src/actions/reshape.ts b/src/actions/reshape.ts index 79982ad..b808c3d 100644 --- a/src/actions/reshape.ts +++ b/src/actions/reshape.ts @@ -1,12 +1,12 @@ import CutByImage from "./reshape/CutByImage.js"; -import {ImageSource} from "../qualifiers/source/sourceTypes/ImageSource.js"; -import {DistortArcAction} from "./reshape/DistortArc.js"; -import {ShearAction} from "./reshape/Shear.js"; -import {DistortAction, IDistortCoordinates} from "./reshape/Distort.js"; -import {TrimAction} from "./reshape/TrimAction.js"; -import {TextSource} from "../qualifiers/source/sourceTypes/TextSource.js"; -import {FetchSource} from "../qualifiers/source/sourceTypes/FetchSource.js"; -import {stringOrNumber} from "../types/types.js"; +import { ImageSource } from "../qualifiers/source/sourceTypes/ImageSource.js"; +import { DistortArcAction } from "./reshape/DistortArc.js"; +import { ShearAction } from "./reshape/Shear.js"; +import { DistortAction, IDistortCoordinates } from "./reshape/Distort.js"; +import { TrimAction } from "./reshape/TrimAction.js"; +import { TextSource } from "../qualifiers/source/sourceTypes/TextSource.js"; +import { FetchSource } from "../qualifiers/source/sourceTypes/FetchSource.js"; +import { stringOrNumber } from "../types/types.js"; type IReshape = CutByImage | DistortArcAction; @@ -20,8 +20,6 @@ type IReshape = CutByImage | DistortArcAction; * // Expand every function separately to see its own example */ - - /** * @summary action * @description Trims pixels according to the transparency levels of a given overlay image. @@ -155,5 +153,5 @@ function trim(): TrimAction { return new TrimAction(); } -const Reshape = {cutByImage, distortArc, distort, shear, trim}; -export {cutByImage, Reshape, IReshape, distortArc, distort, shear, trim}; +const Reshape = { cutByImage, distortArc, distort, shear, trim }; +export { cutByImage, Reshape, IReshape, distortArc, distort, shear, trim }; diff --git a/src/actions/reshape/CutByImage.ts b/src/actions/reshape/CutByImage.ts index 14a8b64..23b7cc4 100644 --- a/src/actions/reshape/CutByImage.ts +++ b/src/actions/reshape/CutByImage.ts @@ -1,10 +1,10 @@ -import {Action} from "../../internal/Action.js"; -import {PositionQualifier} from "../../qualifiers/position/PositionQualifier.js"; -import {ImageSource} from "../../qualifiers/source/sourceTypes/ImageSource.js"; -import {Position} from "../../qualifiers/position.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {TextSource} from "../../qualifiers/source/sourceTypes/TextSource.js"; -import {FetchSource} from "../../qualifiers/source/sourceTypes/FetchSource.js"; +import { Action } from "../../internal/Action.js"; +import { PositionQualifier } from "../../qualifiers/position/PositionQualifier.js"; +import { ImageSource } from "../../qualifiers/source/sourceTypes/ImageSource.js"; +import { Position } from "../../qualifiers/position.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { TextSource } from "../../qualifiers/source/sourceTypes/TextSource.js"; +import { FetchSource } from "../../qualifiers/source/sourceTypes/FetchSource.js"; /** * @description Trims pixels according to the transparency levels of a given overlay image. @@ -27,7 +27,7 @@ class CutByImage extends Action { * @param {Qualifiers.Position} position The position of the overlay with respect to the base image. * @return {this} */ - position(position:PositionQualifier): this { + position(position: PositionQualifier): this { this._position = position; return this; } @@ -37,19 +37,14 @@ class CutByImage extends Action { // Our implementation prevents two `fl` keys in the same URL component // We also don't want to concatenate flags (fl_layer_apply.cutter) // We use this trick to create two separate flags - close.addQualifier(new Qualifier('fl', 'cutter,fl_layer_apply')); + close.addQualifier(new Qualifier("fl", "cutter,fl_layer_apply")); this._position?.qualifiers.forEach((qualifier) => { close.addQualifier(qualifier); }); - return [ - this.source.getOpenSourceString('l'), - this.source.getTransformation(), - close - ].filter((a) => a).join('/'); + return [this.source.getOpenSourceString("l"), this.source.getTransformation(), close].filter((a) => a).join("/"); } } - export default CutByImage; diff --git a/src/actions/reshape/Distort.ts b/src/actions/reshape/Distort.ts index ce01030..e56e3ce 100644 --- a/src/actions/reshape/Distort.ts +++ b/src/actions/reshape/Distort.ts @@ -1,6 +1,5 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; - +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; export type IDistortCoordinates = [number, number, number, number, number, number, number, number]; @@ -19,9 +18,8 @@ class DistortAction extends Action { constructor(coordinates: IDistortCoordinates) { super(); - this.addQualifier(new Qualifier('e', `distort:${coordinates.join(':')}`)); + this.addQualifier(new Qualifier("e", `distort:${coordinates.join(":")}`)); } } - -export {DistortAction}; +export { DistortAction }; diff --git a/src/actions/reshape/DistortArc.ts b/src/actions/reshape/DistortArc.ts index f899f48..8ab7efc 100644 --- a/src/actions/reshape/DistortArc.ts +++ b/src/actions/reshape/DistortArc.ts @@ -1,5 +1,5 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @description Distorts the image to an arc shape. @@ -14,9 +14,8 @@ import {Qualifier} from "../../internal/qualifier/Qualifier.js"; class DistortArcAction extends Action { constructor(degrees: number | string) { super(); - this.addQualifier(new Qualifier('e', `distort:arc:${degrees}`)); + this.addQualifier(new Qualifier("e", `distort:arc:${degrees}`)); } } - -export {DistortArcAction}; +export { DistortArcAction }; diff --git a/src/actions/reshape/Shear.ts b/src/actions/reshape/Shear.ts index 64c8991..4a8d767 100644 --- a/src/actions/reshape/Shear.ts +++ b/src/actions/reshape/Shear.ts @@ -1,5 +1,5 @@ -import {Action} from "../../internal/Action.js"; -import {stringOrNumber} from "../../types/types.js"; +import { Action } from "../../internal/Action.js"; +import { stringOrNumber } from "../../types/types.js"; /** * @description Skews the image according to the two specified values in degrees. @@ -11,7 +11,7 @@ class ShearAction extends Action { private _x: stringOrNumber; private _y: stringOrNumber; - constructor(x: stringOrNumber, y:stringOrNumber) { + constructor(x: stringOrNumber, y: stringOrNumber) { super(); this.skewX(x); this.skewY(y); @@ -33,13 +33,8 @@ class ShearAction extends Action { } toString(): string { - return [ - 'e_shear', - this._x, - this._y - ].filter((a) => a).join(':'); + return ["e_shear", this._x, this._y].filter((a) => a).join(":"); } } - -export {ShearAction}; +export { ShearAction }; diff --git a/src/actions/reshape/TrimAction.ts b/src/actions/reshape/TrimAction.ts index b5e1e53..b16e4e7 100644 --- a/src/actions/reshape/TrimAction.ts +++ b/src/actions/reshape/TrimAction.ts @@ -1,5 +1,5 @@ -import {Action} from "../../internal/Action.js"; -import {SystemColors} from "../../qualifiers/color.js"; +import { Action } from "../../internal/Action.js"; +import { SystemColors } from "../../qualifiers/color.js"; /** * @description Removes the edges of the image based on the color of the corner pixels. @@ -32,13 +32,8 @@ class TrimAction extends Action { // image.reshape(Reshape.trim()->colorSimilarity(50)->colorOverride(Color.YELLOW)); // e_trim:50:yellow - return [ - 'e_trim', - this._tolerance, - this._color - ].filter((a) => a).join(':'); + return ["e_trim", this._tolerance, this._color].filter((a) => a).join(":"); } } - -export {TrimAction}; +export { TrimAction }; diff --git a/src/actions/resize.ts b/src/actions/resize.ts index cba37a1..a19accd 100644 --- a/src/actions/resize.ts +++ b/src/actions/resize.ts @@ -50,18 +50,18 @@ * image.toString() */ -import {ResizePadAction} from "./resize/ResizePadAction.js"; -import {ResizeSimpleAction} from "./resize/ResizeSimpleAction.js"; -import {ResizeScaleAction} from "./resize/ResizeScaleAction.js"; -import {ThumbResizeAction} from "./resize/ThumbnailAction.js"; -import {AutoGravity} from "../qualifiers/gravity/autoGravity/AutoGravity.js"; -import {CompassGravity} from "../qualifiers/gravity/compassGravity/CompassGravity.js"; -import {ResizeCropAction} from "./resize/ResizeCropAction.js"; -import {ResizeFillAction} from "./resize/ResizeFillAction.js"; -import {ResizeLimitFitAction} from "./resize/ResizeLimitFitAction.js"; -import {ResizeLimitFillAction} from "./resize/ResizeLimitFillAction.js"; -import {ResizeLimitPadAction} from "./resize/ResizeLimitPadAction.js"; -import {ResizeMinimumPadAction} from "./resize/ResizeMinimumPadAction.js"; +import { ResizePadAction } from "./resize/ResizePadAction.js"; +import { ResizeSimpleAction } from "./resize/ResizeSimpleAction.js"; +import { ResizeScaleAction } from "./resize/ResizeScaleAction.js"; +import { ThumbResizeAction } from "./resize/ThumbnailAction.js"; +import { AutoGravity } from "../qualifiers/gravity/autoGravity/AutoGravity.js"; +import { CompassGravity } from "../qualifiers/gravity/compassGravity/CompassGravity.js"; +import { ResizeCropAction } from "./resize/ResizeCropAction.js"; +import { ResizeFillAction } from "./resize/ResizeFillAction.js"; +import { ResizeLimitFitAction } from "./resize/ResizeLimitFitAction.js"; +import { ResizeLimitFillAction } from "./resize/ResizeLimitFillAction.js"; +import { ResizeLimitPadAction } from "./resize/ResizeLimitPadAction.js"; +import { ResizeMinimumPadAction } from "./resize/ResizeMinimumPadAction.js"; /** * @summary action @@ -74,11 +74,9 @@ import {ResizeMinimumPadAction} from "./resize/ResizeMinimumPadAction.js"; * @return {Actions.Resize.ScaleAction} */ function scale(width?: number | string, height?: number | string): ResizeScaleAction { - return new ResizeScaleAction('scale', width, height); + return new ResizeScaleAction("scale", width, height); } - - /** * @summary action * @description @@ -91,10 +89,9 @@ function scale(width?: number | string, height?: number | string): ResizeScaleAc * @return {Actions.Resize.ResizeSimpleAction} */ function imaggaScale(width?: number | string, height?: number | string): ResizeSimpleAction { - return new ResizeSimpleAction('imagga_scale', width, height); + return new ResizeSimpleAction("imagga_scale", width, height); } - /** * @summary action * @description @@ -106,8 +103,8 @@ function imaggaScale(width?: number | string, height?: number | string): ResizeS * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ResizeSimpleAction} */ -function imaggaCrop(width?: number|string, height?: number|string) :ResizeSimpleAction { - return new ResizeSimpleAction('imagga_crop', width, height); +function imaggaCrop(width?: number | string, height?: number | string): ResizeSimpleAction { + return new ResizeSimpleAction("imagga_crop", width, height); } /** @@ -118,8 +115,8 @@ function imaggaCrop(width?: number|string, height?: number|string) :ResizeSimple * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ResizeCropAction} */ -function crop(width?: number|string, height?: number|string) :ResizeCropAction { - return new ResizeCropAction('crop', width, height); +function crop(width?: number | string, height?: number | string): ResizeCropAction { + return new ResizeCropAction("crop", width, height); } /** @@ -133,8 +130,8 @@ function crop(width?: number|string, height?: number|string) :ResizeCropAction { * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ResizeFillAction} */ -function fill(width?: string|number, height?: string|number) :ResizeFillAction { - return new ResizeFillAction('fill', width, height); +function fill(width?: string | number, height?: string | number): ResizeFillAction { + return new ResizeFillAction("fill", width, height); } /** @@ -147,8 +144,8 @@ function fill(width?: string|number, height?: string|number) :ResizeFillAction { * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ResizeSimpleAction} */ -function fit(width?: string|number, height?: string|number) :ResizeSimpleAction { - return new ResizeSimpleAction('fit', width, height); +function fit(width?: string | number, height?: string | number): ResizeSimpleAction { + return new ResizeSimpleAction("fit", width, height); } /** @@ -163,11 +160,10 @@ function fit(width?: string|number, height?: string|number) :ResizeSimpleAction * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ResizePadAction} */ -function pad(width?: string|number, height?: string|number) :ResizePadAction { - return new ResizePadAction('pad', width, height); +function pad(width?: string | number, height?: string | number): ResizePadAction { + return new ResizePadAction("pad", width, height); } - /** * @summary action * @description @@ -183,11 +179,10 @@ function pad(width?: string|number, height?: string|number) :ResizePadAction { - return new ResizeMinimumPadAction('mpad', width, height); +function minimumPad(width?: string | number, height?: string | number): ResizeMinimumPadAction { + return new ResizeMinimumPadAction("mpad", width, height); } - /** * @summary action * @description @@ -235,11 +228,10 @@ function minimumPad(width?: string|number, height?: string|number): ResizeMinimu * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ResizeSimpleAction} */ -function minimumFit(width?: number|string, height?: number|string) :ResizeSimpleAction { - return new ResizeSimpleAction('mfit', width, height); +function minimumFit(width?: number | string, height?: number | string): ResizeSimpleAction { + return new ResizeSimpleAction("mfit", width, height); } - /** * @summary action * @memberOf Actions.Resize @@ -256,8 +248,8 @@ function minimumFit(width?: number|string, height?: number|string) :ResizeSimple * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ResizePadAction} */ -function fillPad(width?: string|number, height?: string|number) :ResizePadAction { - return new ResizePadAction('fill_pad', width, height); +function fillPad(width?: string | number, height?: string | number): ResizePadAction { + return new ResizePadAction("fill_pad", width, height); } /** @@ -270,11 +262,10 @@ function fillPad(width?: string|number, height?: string|number) :ResizePadAction * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ThumbResizeAction} */ -function thumbnail(width?: string|number, height?: string|number) :ThumbResizeAction { - return new ThumbResizeAction('thumb', width, height); +function thumbnail(width?: string | number, height?: string | number): ThumbResizeAction { + return new ThumbResizeAction("thumb", width, height); } - /** * @summary action * @description @@ -289,11 +280,10 @@ function thumbnail(width?: string|number, height?: string|number) :ThumbResizeAc * @param {number|string} height The required height of a transformed asset. * @return {Actions.Resize.ResizePadAction} */ -function limitPad(width?: string|number, height?: string|number) :ResizeLimitPadAction { - return new ResizeLimitPadAction('lpad', width, height); +function limitPad(width?: string | number, height?: string | number): ResizeLimitPadAction { + return new ResizeLimitPadAction("lpad", width, height); } - const Resize = { imaggaScale, imaggaCrop, @@ -308,7 +298,7 @@ const Resize = { limitFill, minimumFit, limitPad, - fillPad + fillPad, }; export { Resize, @@ -325,5 +315,5 @@ export { limitFill, minimumFit, limitPad, - fillPad + fillPad, }; diff --git a/src/actions/resize/ResizeAdvancedAction.ts b/src/actions/resize/ResizeAdvancedAction.ts index 8609bd1..d59b436 100644 --- a/src/actions/resize/ResizeAdvancedAction.ts +++ b/src/actions/resize/ResizeAdvancedAction.ts @@ -1,10 +1,10 @@ -import {ResizeSimpleAction} from "./ResizeSimpleAction.js"; -import {IGravity} from "../../qualifiers/gravity/GravityQualifier.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {createGravityModel, IGravityModel} from "../../internal/models/createGravityModel.js"; -import {createGravityFromModel} from "../../internal/models/createGravityFromModel.js"; -import {IResizeAdvancedActionModel} from "../../internal/models/IResizeAdvancedActionModel.js"; +import { ResizeSimpleAction } from "./ResizeSimpleAction.js"; +import { IGravity } from "../../qualifiers/gravity/GravityQualifier.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { createGravityModel, IGravityModel } from "../../internal/models/createGravityModel.js"; +import { createGravityFromModel } from "../../internal/models/createGravityFromModel.js"; +import { IResizeAdvancedActionModel } from "../../internal/models/IResizeAdvancedActionModel.js"; /** * @description Defines an advanced resize. @@ -12,7 +12,7 @@ import {IResizeAdvancedActionModel} from "../../internal/models/IResizeAdvancedA * @memberOf Actions.Resize * @see Visit {@link Actions.Resize| Resize} for examples */ -class ResizeAdvancedAction extends ResizeSimpleAction{ +class ResizeAdvancedAction extends ResizeSimpleAction { protected _actionModel: IResizeAdvancedActionModel; /** @@ -21,7 +21,7 @@ class ResizeAdvancedAction extends ResizeSimpleAction{ */ gravity(gravity: IGravity): this { this._actionModel.gravity = createGravityModel(gravity); - const gravityQualifier = typeof gravity === "string" ? new Qualifier('g', gravity) : gravity; + const gravityQualifier = typeof gravity === "string" ? new Qualifier("g", gravity) : gravity; return this.addQualifier(gravityQualifier); } @@ -37,4 +37,4 @@ class ResizeAdvancedAction extends ResizeSimpleAction{ } } -export {ResizeAdvancedAction}; +export { ResizeAdvancedAction }; diff --git a/src/actions/resize/ResizeCropAction.ts b/src/actions/resize/ResizeCropAction.ts index 3377a05..30db01d 100644 --- a/src/actions/resize/ResizeCropAction.ts +++ b/src/actions/resize/ResizeCropAction.ts @@ -1,6 +1,6 @@ -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {ResizeAdvancedAction} from "./ResizeAdvancedAction.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { ResizeAdvancedAction } from "./ResizeAdvancedAction.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Defines how to crop an asset @@ -15,7 +15,7 @@ class ResizeCropAction extends ResizeAdvancedAction { */ x(x: number | string): this { this._actionModel.x = x; - return this.addQualifier(new Qualifier('x', x)); + return this.addQualifier(new Qualifier("x", x)); } /** @@ -24,7 +24,7 @@ class ResizeCropAction extends ResizeAdvancedAction { */ y(y: number | string): this { this._actionModel.y = y; - return this.addQualifier(new Qualifier('y', y)); + return this.addQualifier(new Qualifier("y", y)); } /** @@ -33,7 +33,7 @@ class ResizeCropAction extends ResizeAdvancedAction { */ zoom(z: number | string): this { this._actionModel.zoom = z; - return this.addQualifier(new Qualifier('z', z)); + return this.addQualifier(new Qualifier("z", z)); } static fromJson(actionModel: IActionModel): ResizeCropAction { @@ -46,4 +46,4 @@ class ResizeCropAction extends ResizeAdvancedAction { } } -export {ResizeCropAction}; +export { ResizeCropAction }; diff --git a/src/actions/resize/ResizeFillAction.ts b/src/actions/resize/ResizeFillAction.ts index 5fe66ad..46f12a4 100644 --- a/src/actions/resize/ResizeFillAction.ts +++ b/src/actions/resize/ResizeFillAction.ts @@ -1,6 +1,6 @@ -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {ResizeAdvancedAction} from "./ResizeAdvancedAction.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { ResizeAdvancedAction } from "./ResizeAdvancedAction.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Defines how to crop-fill an asset @@ -15,7 +15,7 @@ class ResizeFillAction extends ResizeAdvancedAction { */ x(x: number | string): this { this._actionModel.x = x; - return this.addQualifier(new Qualifier('x', x)); + return this.addQualifier(new Qualifier("x", x)); } /** @@ -24,7 +24,7 @@ class ResizeFillAction extends ResizeAdvancedAction { */ y(y: number | string): this { this._actionModel.y = y; - return this.addQualifier(new Qualifier('y', y)); + return this.addQualifier(new Qualifier("y", y)); } static fromJson(actionModel: IActionModel): ResizeFillAction { @@ -36,5 +36,4 @@ class ResizeFillAction extends ResizeAdvancedAction { } } - -export {ResizeFillAction}; +export { ResizeFillAction }; diff --git a/src/actions/resize/ResizeFitAction.ts b/src/actions/resize/ResizeFitAction.ts index f2908c0..de8214f 100644 --- a/src/actions/resize/ResizeFitAction.ts +++ b/src/actions/resize/ResizeFitAction.ts @@ -1,4 +1,4 @@ -import {ResizeSimpleAction} from "./ResizeSimpleAction.js"; +import { ResizeSimpleAction } from "./ResizeSimpleAction.js"; /** * @description Defines a fitting resize action. @@ -8,4 +8,4 @@ import {ResizeSimpleAction} from "./ResizeSimpleAction.js"; */ class ResizeFitAction extends ResizeSimpleAction {} -export {ResizeFitAction}; +export { ResizeFitAction }; diff --git a/src/actions/resize/ResizeLimitFillAction.ts b/src/actions/resize/ResizeLimitFillAction.ts index 71b873e..b7a9529 100644 --- a/src/actions/resize/ResizeLimitFillAction.ts +++ b/src/actions/resize/ResizeLimitFillAction.ts @@ -1,4 +1,4 @@ -import {ResizeFillAction} from "./ResizeFillAction.js"; +import { ResizeFillAction } from "./ResizeFillAction.js"; /** * @description Defines how to crop-limit-fill an asset @@ -8,4 +8,4 @@ import {ResizeFillAction} from "./ResizeFillAction.js"; */ class ResizeLimitFillAction extends ResizeFillAction {} -export {ResizeLimitFillAction}; +export { ResizeLimitFillAction }; diff --git a/src/actions/resize/ResizeLimitFitAction.ts b/src/actions/resize/ResizeLimitFitAction.ts index 3c859e0..7a7891e 100644 --- a/src/actions/resize/ResizeLimitFitAction.ts +++ b/src/actions/resize/ResizeLimitFitAction.ts @@ -1,4 +1,4 @@ -import {ResizeSimpleAction} from "./ResizeSimpleAction.js"; +import { ResizeSimpleAction } from "./ResizeSimpleAction.js"; /** * @description Defines a limit fitting resize action. @@ -8,4 +8,4 @@ import {ResizeSimpleAction} from "./ResizeSimpleAction.js"; */ class ResizeLimitFitAction extends ResizeSimpleAction {} -export {ResizeLimitFitAction}; +export { ResizeLimitFitAction }; diff --git a/src/actions/resize/ResizeLimitPadAction.ts b/src/actions/resize/ResizeLimitPadAction.ts index b22d797..e32e775 100644 --- a/src/actions/resize/ResizeLimitPadAction.ts +++ b/src/actions/resize/ResizeLimitPadAction.ts @@ -1,5 +1,5 @@ -import {IGravity} from "../../qualifiers/gravity/GravityQualifier.js"; -import {ResizePadAction} from "./ResizePadAction.js"; +import { IGravity } from "../../qualifiers/gravity/GravityQualifier.js"; +import { ResizePadAction } from "./ResizePadAction.js"; /** * @description Defines an advanced resize with limit padding. @@ -9,4 +9,4 @@ import {ResizePadAction} from "./ResizePadAction.js"; */ class ResizeLimitPadAction extends ResizePadAction {} -export {ResizeLimitPadAction}; +export { ResizeLimitPadAction }; diff --git a/src/actions/resize/ResizeMinimumFitAction.ts b/src/actions/resize/ResizeMinimumFitAction.ts index 1bfe745..c6eca02 100644 --- a/src/actions/resize/ResizeMinimumFitAction.ts +++ b/src/actions/resize/ResizeMinimumFitAction.ts @@ -1,4 +1,4 @@ -import {ResizeSimpleAction} from "./ResizeSimpleAction.js"; +import { ResizeSimpleAction } from "./ResizeSimpleAction.js"; /** * @description Defines a minimum fitting resize action. @@ -8,4 +8,4 @@ import {ResizeSimpleAction} from "./ResizeSimpleAction.js"; */ class ResizeMinimumFitAction extends ResizeSimpleAction {} -export {ResizeMinimumFitAction}; +export { ResizeMinimumFitAction }; diff --git a/src/actions/resize/ResizeMinimumPadAction.ts b/src/actions/resize/ResizeMinimumPadAction.ts index 374d7a3..8e73df0 100644 --- a/src/actions/resize/ResizeMinimumPadAction.ts +++ b/src/actions/resize/ResizeMinimumPadAction.ts @@ -1,5 +1,5 @@ -import {IGravity} from "../../qualifiers/gravity/GravityQualifier.js"; -import {ResizePadAction} from "./ResizePadAction.js"; +import { IGravity } from "../../qualifiers/gravity/GravityQualifier.js"; +import { ResizePadAction } from "./ResizePadAction.js"; /** * @description Defines an advanced resize with minimum padding. @@ -9,4 +9,4 @@ import {ResizePadAction} from "./ResizePadAction.js"; */ class ResizeMinimumPadAction extends ResizePadAction {} -export {ResizeMinimumPadAction}; +export { ResizeMinimumPadAction }; diff --git a/src/actions/resize/ResizePadAction.ts b/src/actions/resize/ResizePadAction.ts index 29133d7..cec3dea 100644 --- a/src/actions/resize/ResizePadAction.ts +++ b/src/actions/resize/ResizePadAction.ts @@ -1,12 +1,15 @@ -import {BackgroundQualifier} from "../../qualifiers/background/shared/base/BackgroundQualifier.js"; -import {IGravity} from "../../qualifiers/gravity/GravityQualifier.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {ResizeAdvancedAction} from "./ResizeAdvancedAction.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {CompassGravity} from "../../qualifiers/gravity/compassGravity/CompassGravity.js"; -import {createBackgroundModel, IBackgroundModel} from "../../internal/models/createBackgroundModel.js"; -import {createBackgroundFromModel} from "../../internal/models/createBackgroundFromModel.js"; -import {BackgroundGenerativeFillQualifier, isGenerativeFillBackgroundValue} from "../../qualifiers/background/shared/BackgroundGenerativeFillQualifier.js"; +import { BackgroundQualifier } from "../../qualifiers/background/shared/base/BackgroundQualifier.js"; +import { IGravity } from "../../qualifiers/gravity/GravityQualifier.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { ResizeAdvancedAction } from "./ResizeAdvancedAction.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { CompassGravity } from "../../qualifiers/gravity/compassGravity/CompassGravity.js"; +import { createBackgroundModel, IBackgroundModel } from "../../internal/models/createBackgroundModel.js"; +import { createBackgroundFromModel } from "../../internal/models/createBackgroundFromModel.js"; +import { + BackgroundGenerativeFillQualifier, + isGenerativeFillBackgroundValue, +} from "../../qualifiers/background/shared/BackgroundGenerativeFillQualifier.js"; /** * @description Defines an advanced resize with padding. @@ -38,7 +41,7 @@ class ResizePadAction extends ResizeAdvancedAction */ offsetX(x: number | string): this { this._actionModel.x = x; - return this.addQualifier(new Qualifier('x', x)); + return this.addQualifier(new Qualifier("x", x)); } /** @@ -47,7 +50,7 @@ class ResizePadAction extends ResizeAdvancedAction */ offsetY(y: number | string): this { this._actionModel.y = y; - return this.addQualifier(new Qualifier('y', y)); + return this.addQualifier(new Qualifier("y", y)); } static fromJson(actionModel: IActionModel): ResizePadAction { @@ -61,5 +64,4 @@ class ResizePadAction extends ResizeAdvancedAction } } - -export {ResizePadAction}; +export { ResizePadAction }; diff --git a/src/actions/resize/ResizeScaleAction.ts b/src/actions/resize/ResizeScaleAction.ts index 258af45..57fc1d5 100644 --- a/src/actions/resize/ResizeScaleAction.ts +++ b/src/actions/resize/ResizeScaleAction.ts @@ -1,5 +1,5 @@ -import {ResizeSimpleAction} from "./ResizeSimpleAction.js"; -import {GravityQualifier} from "../../qualifiers/gravity/GravityQualifier.js"; +import { ResizeSimpleAction } from "./ResizeSimpleAction.js"; +import { GravityQualifier } from "../../qualifiers/gravity/GravityQualifier.js"; /** * @description Defines a scaling resize action. @@ -14,8 +14,8 @@ class ResizeScaleAction extends ResizeSimpleAction { * @return {this} */ liquidRescaling(): this { - return this.addQualifier(new GravityQualifier('liquid')); + return this.addQualifier(new GravityQualifier("liquid")); } } -export {ResizeScaleAction}; +export { ResizeScaleAction }; diff --git a/src/actions/resize/ResizeSimpleAction.ts b/src/actions/resize/ResizeSimpleAction.ts index 6070fed..92ac30c 100644 --- a/src/actions/resize/ResizeSimpleAction.ts +++ b/src/actions/resize/ResizeSimpleAction.ts @@ -1,14 +1,14 @@ -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {Action} from "../../internal/Action.js"; -import {toFloatAsString} from "../../internal/utils/toFloatAsString.js"; -import {AspectRatioQualifierValue} from "../../qualifiers/aspectRatio/AspectRatioQualifierValue.js"; -import {ignoreInitialAspectRatio, regionRelative, relative} from "../../qualifiers/flag.js"; -import {FlagQualifier} from "../../qualifiers/flag/FlagQualifier.js"; -import {ExpressionQualifier} from "../../qualifiers/expression/ExpressionQualifier.js"; -import {AspectRatioType} from "../../types/types.js"; -import {IResizeSimpleActionModel} from "../../internal/models/IResizeSimpleActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {ACTION_TYPE_TO_CROP_MODE_MAP, CROP_MODE_TO_ACTION_TYPE_MAP} from "../../internal/internalConstants.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { Action } from "../../internal/Action.js"; +import { toFloatAsString } from "../../internal/utils/toFloatAsString.js"; +import { AspectRatioQualifierValue } from "../../qualifiers/aspectRatio/AspectRatioQualifierValue.js"; +import { ignoreInitialAspectRatio, regionRelative, relative } from "../../qualifiers/flag.js"; +import { FlagQualifier } from "../../qualifiers/flag/FlagQualifier.js"; +import { ExpressionQualifier } from "../../qualifiers/expression/ExpressionQualifier.js"; +import { AspectRatioType } from "../../types/types.js"; +import { IResizeSimpleActionModel } from "../../internal/models/IResizeSimpleActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { ACTION_TYPE_TO_CROP_MODE_MAP, CROP_MODE_TO_ACTION_TYPE_MAP } from "../../internal/internalConstants.js"; /** * @description Defines a resize using width and height. @@ -26,9 +26,9 @@ class ResizeSimpleAction extends Action { */ constructor(cropType: string, cropWidth: number | string, cropHeight?: number | string) { super(); - this._actionModel = {dimensions: {}}; + this._actionModel = { dimensions: {} }; this._actionModel.actionType = CROP_MODE_TO_ACTION_TYPE_MAP[cropType] || cropType; - this.addQualifier(new Qualifier('c', cropType)); + this.addQualifier(new Qualifier("c", cropType)); cropWidth && this.width(cropWidth); cropHeight && this.height(cropHeight); } @@ -39,7 +39,7 @@ class ResizeSimpleAction extends Action { */ height(x: number | string | ExpressionQualifier): this { this._actionModel.dimensions.height = x as string; - return this.addQualifier(new Qualifier('h', x)); + return this.addQualifier(new Qualifier("h", x)); } /** @@ -48,13 +48,13 @@ class ResizeSimpleAction extends Action { */ width(x: number | string | ExpressionQualifier): this { this._actionModel.dimensions.width = x as string; - return this.addQualifier(new Qualifier('w', x)); + return this.addQualifier(new Qualifier("w", x)); } /** * @description Sets the aspect ratio of the asset. * For a list of supported types see {@link Qualifiers.AspectRatio| - * AspectRatio values} + * AspectRatio values} * @param {AspectRatioType|number|string} ratio The new aspect ratio, specified as a percentage or ratio. * @return {this} */ @@ -62,12 +62,12 @@ class ResizeSimpleAction extends Action { // toFloatAsString is used to ensure 1 turns into 1.0 if (ratio instanceof AspectRatioQualifierValue) { this._actionModel.dimensions.aspectRatio = `${ratio}`; - return this.addQualifier(new Qualifier('ar', ratio)); + return this.addQualifier(new Qualifier("ar", ratio)); } - if (typeof ratio === 'number' || typeof ratio === 'string') { + if (typeof ratio === "number" || typeof ratio === "string") { this._actionModel.dimensions.aspectRatio = toFloatAsString(ratio); - return this.addQualifier(new Qualifier('ar', toFloatAsString(ratio))); + return this.addQualifier(new Qualifier("ar", toFloatAsString(ratio))); } if (ratio instanceof FlagQualifier) { @@ -95,15 +95,15 @@ class ResizeSimpleAction extends Action { } static fromJson(actionModel: IActionModel): ResizeSimpleAction { - const {actionType, dimensions, relative, regionRelative} = (actionModel as IResizeSimpleActionModel); - const {aspectRatio, width, height} = dimensions; + const { actionType, dimensions, relative, regionRelative } = actionModel as IResizeSimpleActionModel; + const { aspectRatio, width, height } = dimensions; const cropMode = ACTION_TYPE_TO_CROP_MODE_MAP[actionType] || actionType; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(cropMode, width, height); - aspectRatio && result.aspectRatio(aspectRatio === 'ignore_aspect_ratio' ? ignoreInitialAspectRatio() : aspectRatio); + aspectRatio && result.aspectRatio(aspectRatio === "ignore_aspect_ratio" ? ignoreInitialAspectRatio() : aspectRatio); relative && result.relative(); regionRelative && result.regionRelative(); @@ -111,4 +111,4 @@ class ResizeSimpleAction extends Action { } } -export {ResizeSimpleAction}; +export { ResizeSimpleAction }; diff --git a/src/actions/resize/ThumbnailAction.ts b/src/actions/resize/ThumbnailAction.ts index 0ef5be5..587e9ba 100644 --- a/src/actions/resize/ThumbnailAction.ts +++ b/src/actions/resize/ThumbnailAction.ts @@ -1,6 +1,6 @@ -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {ResizeAdvancedAction} from "./ResizeAdvancedAction.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { ResizeAdvancedAction } from "./ResizeAdvancedAction.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Defines a thumbnail resize action. @@ -15,7 +15,7 @@ class ThumbResizeAction extends ResizeAdvancedAction { */ zoom(z: number | string): this { this._actionModel.zoom = z; - return this.addQualifier(new Qualifier('z', z)); + return this.addQualifier(new Qualifier("z", z)); } static fromJson(actionModel: IActionModel): ThumbResizeAction { @@ -26,5 +26,4 @@ class ThumbResizeAction extends ResizeAdvancedAction { } } - -export {ThumbResizeAction}; +export { ThumbResizeAction }; diff --git a/src/actions/rotate.ts b/src/actions/rotate.ts index cb123c1..fbf13de 100644 --- a/src/actions/rotate.ts +++ b/src/actions/rotate.ts @@ -21,11 +21,10 @@ * image.toString(); */ -import {RotationModeQualifierValue} from "../qualifiers/rotate/RotationModeQualifierValue.js"; -import {RotationModeType} from "../types/types.js"; +import { RotationModeQualifierValue } from "../qualifiers/rotate/RotationModeQualifierValue.js"; +import { RotationModeType } from "../types/types.js"; import RotateAction from "./rotate/RotateAction.js"; - /** * @summary action * @description Rotate an image by using a rotationMode @@ -35,7 +34,7 @@ import RotateAction from "./rotate/RotateAction.js"; * @memberOf Actions.Rotate * @return {Actions.Rotate.RotateAction} */ -function mode(rotationMode: RotationModeQualifierValue | RotationModeType | string) :RotateAction { +function mode(rotationMode: RotationModeQualifierValue | RotationModeType | string): RotateAction { return new RotateAction().mode(rotationMode); } @@ -46,10 +45,9 @@ function mode(rotationMode: RotationModeQualifierValue | RotationModeType | stri * @return {Actions.Rotate.RotateAction} * @memberOf Actions.Rotate */ -function byAngle(angle: number) :RotateAction { +function byAngle(angle: number): RotateAction { return new RotateAction(angle); } - -const Rotate = {byAngle, mode}; -export {Rotate, byAngle, mode}; +const Rotate = { byAngle, mode }; +export { Rotate, byAngle, mode }; diff --git a/src/actions/rotate/RotateAction.ts b/src/actions/rotate/RotateAction.ts index dd7c2b4..120ca28 100644 --- a/src/actions/rotate/RotateAction.ts +++ b/src/actions/rotate/RotateAction.ts @@ -1,12 +1,11 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {RotationModeQualifierValue} from "../../qualifiers/rotate/RotationModeQualifierValue.js"; -import {RotationModeType} from "../../types/types.js"; -import {IRotateByAngleActionModel} from "../../internal/models/IRotateActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; - -const QUALIFIER_KEY = 'a'; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { RotationModeQualifierValue } from "../../qualifiers/rotate/RotationModeQualifierValue.js"; +import { RotationModeType } from "../../types/types.js"; +import { IRotateByAngleActionModel } from "../../internal/models/IRotateActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +const QUALIFIER_KEY = "a"; /** * @description Rotates or flips an image or video. @@ -22,7 +21,7 @@ class RotateAction extends Action { constructor(angle?: number) { super(); this.addQualifier(new Qualifier(QUALIFIER_KEY, angle)); - this._actionModel.actionType = 'rotateByAngle'; + this._actionModel.actionType = "rotateByAngle"; if (angle) { this._actionModel.angle = angle; @@ -36,7 +35,7 @@ class RotateAction extends Action { * possible values * @return {this} */ - mode(rotationMode: RotationModeQualifierValue | RotationModeType | string):this { + mode(rotationMode: RotationModeQualifierValue | RotationModeType | string): this { return this.addValueToQualifier(QUALIFIER_KEY, rotationMode); } @@ -51,7 +50,7 @@ class RotateAction extends Action { } static fromJson(actionModel: IActionModel): RotateAction { - const {angle} = (actionModel as IRotateByAngleActionModel); + const { angle } = actionModel as IRotateByAngleActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created diff --git a/src/actions/roundCorners.ts b/src/actions/roundCorners.ts index 74cce89..8ba5226 100644 --- a/src/actions/roundCorners.ts +++ b/src/actions/roundCorners.ts @@ -20,7 +20,6 @@ * image.toString(); */ - import RoundCornersAction from "./roundCorners/RoundCornersAction.js"; /** @@ -29,7 +28,7 @@ import RoundCornersAction from "./roundCorners/RoundCornersAction.js"; * @memberOf Actions.RoundCorners * @return {Actions.RoundCorners.RoundCornersAction} */ -function max():RoundCornersAction { +function max(): RoundCornersAction { return new RoundCornersAction().max(); } @@ -49,10 +48,9 @@ function max():RoundCornersAction { * @memberOf Actions.RoundCorners * @return {Actions.RoundCorners.RoundCornersAction} */ -function byRadius(a:number, b?:number, c?:number, d?:number):RoundCornersAction { +function byRadius(a: number, b?: number, c?: number, d?: number): RoundCornersAction { return new RoundCornersAction().radius(a, b, c, d); } -const RoundCorners = {byRadius, max}; -export {RoundCorners, byRadius, max}; - +const RoundCorners = { byRadius, max }; +export { RoundCorners, byRadius, max }; diff --git a/src/actions/roundCorners/RoundCornersAction.ts b/src/actions/roundCorners/RoundCornersAction.ts index 7ac636f..891b941 100644 --- a/src/actions/roundCorners/RoundCornersAction.ts +++ b/src/actions/roundCorners/RoundCornersAction.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {IRoundCornersActionModel, CornerRadiusValueType} from "../../internal/models/IRoundCornersActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { IRoundCornersActionModel, CornerRadiusValueType } from "../../internal/models/IRoundCornersActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description A class to round one or more corners of an image or video. @@ -16,7 +16,7 @@ class RoundCornersAction extends Action { constructor() { super(); - this._actionModel.actionType = 'roundCorners'; + this._actionModel.actionType = "roundCorners"; } /** @@ -35,11 +35,11 @@ class RoundCornersAction extends Action { c !== undefined && qualifierValue.addValue(c); d !== undefined && qualifierValue.addValue(d); - const definedRadiuses = ([a, b, c, d].filter((r) => r !== undefined) as [number?, number?, number?, number?]); + const definedRadiuses = [a, b, c, d].filter((r) => r !== undefined) as [number?, number?, number?, number?]; this._radius = definedRadiuses; this._actionModel.radius = definedRadiuses; - this.addQualifier(new Qualifier('r').addValue(qualifierValue)); + this.addQualifier(new Qualifier("r").addValue(qualifierValue)); return this; } @@ -47,10 +47,10 @@ class RoundCornersAction extends Action { * @description Applies maximum rounding to the corners of the asset. An asset with square dimensions becomes a circle. */ max(): this { - this._radius = 'max'; - this._actionModel.radius = 'max'; + this._radius = "max"; + this._actionModel.radius = "max"; - return this.addQualifier(new Qualifier('r', 'max')); + return this.addQualifier(new Qualifier("r", "max")); } getRadius(): CornerRadiusValueType { @@ -58,7 +58,7 @@ class RoundCornersAction extends Action { } static fromJson(actionModel: IActionModel): RoundCornersAction { - const { radius } = (actionModel as IRoundCornersActionModel); + const { radius } = actionModel as IRoundCornersActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created @@ -66,7 +66,7 @@ class RoundCornersAction extends Action { if (Array.isArray(radius)) { result.radius(radius[0], radius[1], radius[2], radius[3]); } - if (radius === 'max') { + if (radius === "max") { result.max(); } diff --git a/src/actions/transcode.ts b/src/actions/transcode.ts index 0a4c799..d29266f 100644 --- a/src/actions/transcode.ts +++ b/src/actions/transcode.ts @@ -6,12 +6,13 @@ import FPSRangeAction from "./transcode/FPSRangeAction.js"; import KeyframeIntervalsAction from "./transcode/KeyframeIntervalsAction.js"; import StreamingProfileAction from "./transcode/StreamingProfile.js"; import ToAnimatedAction from "./transcode/ToAnimatedAction.js"; -import {AnimatedFormatQualifierValue} from "../qualifiers/animatedFormat/AnimatedFormatQualifierValue.js"; -import {AdvVideoCodecType, VideoCodecType} from "../qualifiers/videoCodecType/VideoCodecType.js"; -import {VideoCodecAction} from "./transcode/VideoCodecAction.js"; -import {AnimatedFormatType, AudioCodecType, AudioFrequencyType, StreamingProfileTypes} from "../types/types.js"; +import { AnimatedFormatQualifierValue } from "../qualifiers/animatedFormat/AnimatedFormatQualifierValue.js"; +import { AdvVideoCodecType, VideoCodecType } from "../qualifiers/videoCodecType/VideoCodecType.js"; +import { VideoCodecAction } from "./transcode/VideoCodecAction.js"; +import { AnimatedFormatType, AudioCodecType, AudioFrequencyType, StreamingProfileTypes } from "../types/types.js"; -export type ITranscodeAction = BitRateAction +export type ITranscodeAction = + | BitRateAction | AudioCodecAction | AudioFrequencyAction | FPSAction @@ -19,7 +20,7 @@ export type ITranscodeAction = BitRateAction | KeyframeIntervalsAction | StreamingProfileAction | ToAnimatedAction - | VideoCodecAction + | VideoCodecAction; /** * @description Defines how to transcode a video to another format @@ -50,7 +51,7 @@ export type ITranscodeAction = BitRateAction * @return {Actions.Transcode.AudioFrequencyAction} * */ -function audioFrequency(freq: AudioFrequencyType|string|number): AudioFrequencyAction{ +function audioFrequency(freq: AudioFrequencyType | string | number): AudioFrequencyAction { return new AudioFrequencyAction(freq); } /** @@ -69,7 +70,7 @@ function audioFrequency(freq: AudioFrequencyType|string|number): AudioFrequencyA * video.transcode( audioCodec( aac() ) ); * @return {Actions.Transcode.AudioCodecAction} */ -function audioCodec(codec: AudioCodecType | string): AudioCodecAction{ +function audioCodec(codec: AudioCodecType | string): AudioCodecAction { return new AudioCodecAction(codec); } /** @@ -94,7 +95,7 @@ function audioCodec(codec: AudioCodecType | string): AudioCodecAction{ * video.transcode( bitRate(500).constant() ); * @return {Actions.Transcode.BitRateAction} */ -function bitRate(bitRate: string|number): BitRateAction { +function bitRate(bitRate: string | number): BitRateAction { return new BitRateAction(bitRate); } @@ -195,7 +196,7 @@ function streamingProfile(profile: StreamingProfileTypes | string): StreamingPro * video.transcode( toAnimated( gif() ) ); * @return {Actions.Transcode.ToAnimatedAction} */ -function toAnimated(animatedFormat: AnimatedFormatQualifierValue | AnimatedFormatType | string = ''): ToAnimatedAction { +function toAnimated(animatedFormat: AnimatedFormatQualifierValue | AnimatedFormatType | string = ""): ToAnimatedAction { return new ToAnimatedAction(animatedFormat); } @@ -219,5 +220,26 @@ function videoCodec(videoCodecType: VideoCodecType | AdvVideoCodecType): VideoCo return new VideoCodecAction(videoCodecType); } -const Transcode = {bitRate, audioCodec, audioFrequency, fps, fpsRange, keyframeInterval, streamingProfile, toAnimated, videoCodec}; -export {Transcode, bitRate, audioCodec, audioFrequency, fps, fpsRange, keyframeInterval, streamingProfile, toAnimated, videoCodec}; +const Transcode = { + bitRate, + audioCodec, + audioFrequency, + fps, + fpsRange, + keyframeInterval, + streamingProfile, + toAnimated, + videoCodec, +}; +export { + Transcode, + bitRate, + audioCodec, + audioFrequency, + fps, + fpsRange, + keyframeInterval, + streamingProfile, + toAnimated, + videoCodec, +}; diff --git a/src/actions/transcode/AudioCodecAction.ts b/src/actions/transcode/AudioCodecAction.ts index 65c0d2e..4392373 100644 --- a/src/actions/transcode/AudioCodecAction.ts +++ b/src/actions/transcode/AudioCodecAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IAudioCodecActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IAudioCodecActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @extends SDK.Action @@ -12,15 +12,15 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; * @see Visit {@link Actions.Transcode|Transcode} for an example */ class AudioCodecAction extends Action { - protected _actionModel : IAudioCodecActionModel = {actionType: 'audioCodec'}; + protected _actionModel: IAudioCodecActionModel = { actionType: "audioCodec" }; constructor(codec: string) { super(); - this.addQualifier(new Qualifier('ac', codec)); + this.addQualifier(new Qualifier("ac", codec)); this._actionModel.audioCodec = codec; } static fromJson(actionModel: IActionModel): AudioCodecAction { - const {audioCodec} = (actionModel as IAudioCodecActionModel); + const { audioCodec } = actionModel as IAudioCodecActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created diff --git a/src/actions/transcode/AudioFrequencyAction.ts b/src/actions/transcode/AudioFrequencyAction.ts index 7df1247..3a11be2 100644 --- a/src/actions/transcode/AudioFrequencyAction.ts +++ b/src/actions/transcode/AudioFrequencyAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IAudioFrequencyActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IAudioFrequencyActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @extends SDK.Action @@ -12,19 +12,21 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; * @see Visit {@link Actions.Transcode|Transcode} for an example */ class AudioFrequencyAction extends Action { - protected _actionModel : IAudioFrequencyActionModel = {actionType: 'audioFrequency'}; - constructor(freq: string|number) { + protected _actionModel: IAudioFrequencyActionModel = { + actionType: "audioFrequency", + }; + constructor(freq: string | number) { super(); - this.addQualifier(new Qualifier('af', freq)); + this.addQualifier(new Qualifier("af", freq)); this._actionModel.audioFrequencyType = freq as string; } static fromJson(actionModel: IActionModel): AudioFrequencyAction { - const {audioFrequencyType} = (actionModel as IAudioFrequencyActionModel); + const { audioFrequencyType } = actionModel as IAudioFrequencyActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created - const result = new this(audioFrequencyType.replace('freq', '')); + const result = new this(audioFrequencyType.replace("freq", "")); return result; } diff --git a/src/actions/transcode/BitRateAction.ts b/src/actions/transcode/BitRateAction.ts index efb3ba3..4f66fd3 100644 --- a/src/actions/transcode/BitRateAction.ts +++ b/src/actions/transcode/BitRateAction.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {IBitRateActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { IBitRateActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @extends SDK.Action @@ -13,11 +13,11 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; * @see Visit {@link Actions.Transcode|Transcode} for an example */ class BitRateAction extends Action { - private bitRate: string|number; + private bitRate: string | number; private isConstant = false; - protected _actionModel : IBitRateActionModel = {actionType: 'bitRate'} + protected _actionModel: IBitRateActionModel = { actionType: "bitRate" }; - constructor(bitRate: string|number) { + constructor(bitRate: string | number) { super(); this.bitRate = bitRate; this._actionModel.bitRate = bitRate; @@ -33,17 +33,17 @@ class BitRateAction extends Action { protected prepareQualifiers(): this { let qualifierValue; - if(this.isConstant) { - qualifierValue = new QualifierValue([this.bitRate, 'constant']).setDelimiter(':'); - }else { + if (this.isConstant) { + qualifierValue = new QualifierValue([this.bitRate, "constant"]).setDelimiter(":"); + } else { qualifierValue = new QualifierValue(this.bitRate); } - this.addQualifier(new Qualifier('br', qualifierValue)); + this.addQualifier(new Qualifier("br", qualifierValue)); return this; } static fromJson(actionModel: IActionModel): BitRateAction { - const {bitRate, constant} = (actionModel as IBitRateActionModel); + const { bitRate, constant } = actionModel as IBitRateActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created diff --git a/src/actions/transcode/FPSAction.ts b/src/actions/transcode/FPSAction.ts index f23c5be..e84d815 100644 --- a/src/actions/transcode/FPSAction.ts +++ b/src/actions/transcode/FPSAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IFPSActionModel, IFPSRangeActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IFPSActionModel, IFPSRangeActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; import FPSRangeAction from "./FPSRangeAction.js"; /** @@ -15,21 +15,21 @@ import FPSRangeAction from "./FPSRangeAction.js"; * @see Visit {@link Actions.Transcode|Transcode} for an example */ class FPSAction extends Action { - protected _actionModel : IFPSActionModel = {actionType: 'fps'}; + protected _actionModel: IFPSActionModel = { actionType: "fps" }; constructor(from: number) { super(); this._actionModel.fps = from; - this.addQualifier(new Qualifier('fps', from)); + this.addQualifier(new Qualifier("fps", from)); } static fromJson(actionModel: IActionModel): FPSAction | FPSRangeAction { - const {fps} = (actionModel as IFPSActionModel); + const { fps } = actionModel as IFPSActionModel; let result; - if(typeof fps === 'object') { + if (typeof fps === "object") { //@ts-ignore result = new FPSRangeAction(fps.from, fps.to); - }else { + } else { result = new this(fps); } // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) diff --git a/src/actions/transcode/FPSRangeAction.ts b/src/actions/transcode/FPSRangeAction.ts index 8471c79..e2d5b3e 100644 --- a/src/actions/transcode/FPSRangeAction.ts +++ b/src/actions/transcode/FPSRangeAction.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {IFPSRangeActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { IFPSRangeActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @extends SDK.Action @@ -17,14 +17,14 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; class FPSRangeAction extends Action { private from: number; private to: number; - protected _actionModel : IFPSRangeActionModel = {}; + protected _actionModel: IFPSRangeActionModel = {}; constructor(from: number, to?: number) { super(); this.from = from; this._actionModel = { - actionType: 'fps', - fps: {from} + actionType: "fps", + fps: { from }, }; if (to != null) { this.to = to; @@ -32,15 +32,14 @@ class FPSRangeAction extends Action { } } - protected prepareQualifiers(): this { let qualifierValue; - if(this.from && this.to) { + if (this.from && this.to) { qualifierValue = new QualifierValue(`${this.from}-${this.to}`); - }else { + } else { qualifierValue = new QualifierValue(`${this.from}-`); } - this.addQualifier(new Qualifier('fps', qualifierValue)); + this.addQualifier(new Qualifier("fps", qualifierValue)); return this; } } diff --git a/src/actions/transcode/KeyframeIntervalsAction.ts b/src/actions/transcode/KeyframeIntervalsAction.ts index 9f6d981..6a12ecd 100644 --- a/src/actions/transcode/KeyframeIntervalsAction.ts +++ b/src/actions/transcode/KeyframeIntervalsAction.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {toFloatAsString} from "../../internal/utils/toFloatAsString.js"; -import {IKeyframeIntervalsActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { toFloatAsString } from "../../internal/utils/toFloatAsString.js"; +import { IKeyframeIntervalsActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @extends SDK.Action @@ -11,15 +11,17 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; * @see Visit {@link Actions.Transcode|Transcode} for an example */ class KeyframeIntervalsAction extends Action { - protected _actionModel : IKeyframeIntervalsActionModel = { actionType: 'keyframeInterval' }; + protected _actionModel: IKeyframeIntervalsActionModel = { + actionType: "keyframeInterval", + }; constructor(interval: number | string) { super(); this._actionModel.interval = interval; - this.addQualifier(new Qualifier('ki', toFloatAsString(interval))); + this.addQualifier(new Qualifier("ki", toFloatAsString(interval))); } static fromJson(actionModel: IActionModel): KeyframeIntervalsAction { - const {interval} = (actionModel as IKeyframeIntervalsActionModel); + const { interval } = actionModel as IKeyframeIntervalsActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created diff --git a/src/actions/transcode/StreamingProfile.ts b/src/actions/transcode/StreamingProfile.ts index b675ac4..e0c4228 100644 --- a/src/actions/transcode/StreamingProfile.ts +++ b/src/actions/transcode/StreamingProfile.ts @@ -1,10 +1,10 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {IStreamingProfileActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { IStreamingProfileActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; import { ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP, - STREAMING_PROFILE_TO_ACTION_TYPE_MAP + STREAMING_PROFILE_TO_ACTION_TYPE_MAP, } from "../../internal/internalConstants.js"; /** @@ -16,15 +16,17 @@ import { * @see Visit {@link Actions.Transcode|Transcode} for an example */ class StreamingProfileAction extends Action { - protected _actionModel : IStreamingProfileActionModel = {actionType: 'streamingProfile'}; - constructor(profile: string|number) { + protected _actionModel: IStreamingProfileActionModel = { + actionType: "streamingProfile", + }; + constructor(profile: string | number) { super(); - this.addQualifier(new Qualifier('sp', profile)); - this._actionModel.profile = STREAMING_PROFILE_TO_ACTION_TYPE_MAP[profile] || profile as string; + this.addQualifier(new Qualifier("sp", profile)); + this._actionModel.profile = STREAMING_PROFILE_TO_ACTION_TYPE_MAP[profile] || (profile as string); } static fromJson(actionModel: IActionModel): StreamingProfileAction { - const {profile} = (actionModel as IStreamingProfileActionModel); + const { profile } = actionModel as IStreamingProfileActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created diff --git a/src/actions/transcode/ToAnimatedAction.ts b/src/actions/transcode/ToAnimatedAction.ts index 673cc3d..40bb29f 100644 --- a/src/actions/transcode/ToAnimatedAction.ts +++ b/src/actions/transcode/ToAnimatedAction.ts @@ -1,10 +1,10 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {AnimatedFormatQualifierValue} from "../../qualifiers/animatedFormat/AnimatedFormatQualifierValue.js"; -import {animatedWebP} from "../../qualifiers/flag.js"; -import {animated} from "../../qualifiers/flag.js"; -import {IToAnimatedActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { AnimatedFormatQualifierValue } from "../../qualifiers/animatedFormat/AnimatedFormatQualifierValue.js"; +import { animatedWebP } from "../../qualifiers/flag.js"; +import { animated } from "../../qualifiers/flag.js"; +import { IToAnimatedActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @extends SDK.Action @@ -15,15 +15,15 @@ import {IActionModel} from "../../internal/models/IActionModel.js"; * @see Visit {@link Actions.Transcode|Transcode} for an example */ class ToAnimatedAction extends Action { - protected _actionModel : IToAnimatedActionModel = {actionType: 'toAnimated'}; - constructor(animatedFormat: AnimatedFormatQualifierValue | string = '') { + protected _actionModel: IToAnimatedActionModel = { actionType: "toAnimated" }; + constructor(animatedFormat: AnimatedFormatQualifierValue | string = "") { super(); - if (animatedFormat.toString() === 'webp'){ + if (animatedFormat.toString() === "webp") { this.addFlag(animatedWebP()); } this.addFlag(animated()); if (animatedFormat) { - this.addQualifier(new Qualifier('f', animatedFormat)); + this.addQualifier(new Qualifier("f", animatedFormat)); } this._actionModel.animatedFormat = animatedFormat as string; } @@ -33,7 +33,7 @@ class ToAnimatedAction extends Action { * @param delayValue The time in milliseconds. */ delay(delayValue: number): this { - this.addQualifier(new Qualifier('dl', delayValue)); + this.addQualifier(new Qualifier("dl", delayValue)); this._actionModel.delay = delayValue; return this; } @@ -43,14 +43,14 @@ class ToAnimatedAction extends Action { * @param sampling As a string (e.g. '2.3s'), samples one frame every 2.3 seconds.
      As a number (e.g. 20), * samples that many equally spaced frames over the duration of the video. */ - sampling(sampling: string|number): this { - this.addQualifier(new Qualifier('vs', sampling)); + sampling(sampling: string | number): this { + this.addQualifier(new Qualifier("vs", sampling)); this._actionModel.sampling = sampling; return this; } static fromJson(actionModel: IActionModel): ToAnimatedAction { - const {animatedFormat, sampling, delay} = (actionModel as IToAnimatedActionModel); + const { animatedFormat, sampling, delay } = actionModel as IToAnimatedActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(animatedFormat); diff --git a/src/actions/transcode/VideoCodecAction.ts b/src/actions/transcode/VideoCodecAction.ts index 298ace8..3397fcd 100644 --- a/src/actions/transcode/VideoCodecAction.ts +++ b/src/actions/transcode/VideoCodecAction.ts @@ -1,8 +1,8 @@ -import {Action} from "../../internal/Action.js"; -import {AdvVideoCodecType, VideoCodecType} from "../../qualifiers/videoCodecType/VideoCodecType.js"; -import {IVideoCodecActionModel} from "../../internal/models/ITranscodeActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {VIDEO_CODEC_TO_TRANSFORMATION} from "../../qualifiers/videoCodec.js"; +import { Action } from "../../internal/Action.js"; +import { AdvVideoCodecType, VideoCodecType } from "../../qualifiers/videoCodecType/VideoCodecType.js"; +import { IVideoCodecActionModel } from "../../internal/models/ITranscodeActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { VIDEO_CODEC_TO_TRANSFORMATION } from "../../qualifiers/videoCodec.js"; /** * @extends SDK.Action @@ -11,18 +11,26 @@ import {VIDEO_CODEC_TO_TRANSFORMATION} from "../../qualifiers/videoCodec.js"; * @see Visit {@link Actions.Transcode|Transcode} for an example */ class VideoCodecAction extends Action { - protected _actionModel : IVideoCodecActionModel = {actionType: 'videoCodec'}; - constructor(videoCodecTypeQualifier : VideoCodecType | AdvVideoCodecType) { + protected _actionModel: IVideoCodecActionModel = { actionType: "videoCodec" }; + constructor(videoCodecTypeQualifier: VideoCodecType | AdvVideoCodecType) { super(); - this._actionModel.videoCodec = {videoCodecName: videoCodecTypeQualifier.getType()}; - - if(videoCodecTypeQualifier instanceof AdvVideoCodecType) { - if(videoCodecTypeQualifier.getProfile()) { - this._actionModel.videoCodec = {profile: videoCodecTypeQualifier.getProfile(), ...this._actionModel.videoCodec}; + this._actionModel.videoCodec = { + videoCodecName: videoCodecTypeQualifier.getType(), + }; + + if (videoCodecTypeQualifier instanceof AdvVideoCodecType) { + if (videoCodecTypeQualifier.getProfile()) { + this._actionModel.videoCodec = { + profile: videoCodecTypeQualifier.getProfile(), + ...this._actionModel.videoCodec, + }; } - if(videoCodecTypeQualifier.getLevel()){ - this._actionModel.videoCodec = {level: videoCodecTypeQualifier.getLevel(), ...this._actionModel.videoCodec}; + if (videoCodecTypeQualifier.getLevel()) { + this._actionModel.videoCodec = { + level: videoCodecTypeQualifier.getLevel(), + ...this._actionModel.videoCodec, + }; } } @@ -30,13 +38,14 @@ class VideoCodecAction extends Action { } static fromJson(actionModel: IActionModel): VideoCodecAction { - const {videoCodec} = (actionModel as IVideoCodecActionModel); + const { videoCodec } = actionModel as IVideoCodecActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(VIDEO_CODEC_TO_TRANSFORMATION[videoCodec.videoCodecName]); //@ts-ignore - videoCodec.profile && new this(VIDEO_CODEC_TO_TRANSFORMATION[videoCodec.videoCodecName].profile(videoCodec.profile)); + videoCodec.profile && + new this(VIDEO_CODEC_TO_TRANSFORMATION[videoCodec.videoCodecName].profile(videoCodec.profile)); //@ts-ignore videoCodec.level && new this(VIDEO_CODEC_TO_TRANSFORMATION[videoCodec.videoCodecName].level(videoCodec.level)); @@ -44,4 +53,4 @@ class VideoCodecAction extends Action { return result; } } -export {VideoCodecAction}; +export { VideoCodecAction }; diff --git a/src/actions/underlay.ts b/src/actions/underlay.ts index d19dfc2..8f1ec25 100644 --- a/src/actions/underlay.ts +++ b/src/actions/underlay.ts @@ -1,8 +1,7 @@ -import {LayerAction} from "./layer/LayerAction.js"; -import {ImageSource} from "../qualifiers/source/sourceTypes/ImageSource.js"; -import {BaseTextSource} from "../qualifiers/source/sourceTypes/BaseTextSource.js"; -import {FetchSource} from "../qualifiers/source/sourceTypes/FetchSource.js"; - +import { LayerAction } from "./layer/LayerAction.js"; +import { ImageSource } from "../qualifiers/source/sourceTypes/ImageSource.js"; +import { BaseTextSource } from "../qualifiers/source/sourceTypes/BaseTextSource.js"; +import { FetchSource } from "../qualifiers/source/sourceTypes/FetchSource.js"; /** * @memberOf Actions @@ -38,9 +37,6 @@ import {FetchSource} from "../qualifiers/source/sourceTypes/FetchSource.js"; * ) */ - - - /** * @summary action * @description Adds a layer for an asset @@ -50,9 +46,8 @@ import {FetchSource} from "../qualifiers/source/sourceTypes/FetchSource.js"; * @return {SDK.LayerAction} */ function source(source: ImageSource | BaseTextSource | FetchSource): LayerAction { - return new LayerAction(source) - .setLayerType('u'); + return new LayerAction(source).setLayerType("u"); } -const Underlay = {source}; -export {Underlay, source}; +const Underlay = { source }; +export { Underlay, source }; diff --git a/src/actions/variable.ts b/src/actions/variable.ts index abd9be9..37e8a2e 100644 --- a/src/actions/variable.ts +++ b/src/actions/variable.ts @@ -2,8 +2,8 @@ import SetAction from "./variable/SetAction.js"; import SetAssetReferenceAction from "./variable/SetAssetReferenceAction.js"; import SetFromContextAction from "./variable/SetFromContextAction.js"; import SetFromMetadataAction from "./variable/SetFromMetadataAction.js"; -import {ExpressionQualifier} from "../qualifiers/expression/ExpressionQualifier.js"; -import {toFloatAsString} from "../internal/utils/toFloatAsString.js"; +import { ExpressionQualifier } from "../qualifiers/expression/ExpressionQualifier.js"; +import { toFloatAsString } from "../internal/utils/toFloatAsString.js"; /** * Defines a new user variable with the given value. @@ -30,7 +30,6 @@ import {toFloatAsString} from "../internal/utils/toFloatAsString.js"; * .resize(scale().width('$foo1').height('$foo2')) */ - /** * @summary action * @description Sets a new user variable with the given value. @@ -40,7 +39,7 @@ import {toFloatAsString} from "../internal/utils/toFloatAsString.js"; * @return {Actions.Variable.SetAction} */ function set(name: string, value: number | string | number[] | string[] | ExpressionQualifier): SetAction { - if (Object.prototype.hasOwnProperty.call(value, 'push')) { + if (Object.prototype.hasOwnProperty.call(value, "push")) { return new SetAction(name, value); } @@ -56,7 +55,7 @@ function set(name: string, value: number | string | number[] | string[] | Expres * @return {Actions.Variable.SetAction} */ function setFloat(name: string, value: number): SetAction { - return new SetAction(name, toFloatAsString(value), ''); + return new SetAction(name, toFloatAsString(value), ""); } /** @@ -69,7 +68,7 @@ function setFloat(name: string, value: number): SetAction { */ function setInteger(name: string, value: number): SetAction { let val = value; - if (typeof value === 'string') { + if (typeof value === "string") { val = parseInt(value); } @@ -80,7 +79,6 @@ function setInteger(name: string, value: number): SetAction { return new SetAction(name, Math.round(val)); } - /** * @summary action * @description Same as 'set', but forces the end value to be a string setString(1) will result in $foo_!1! @@ -93,9 +91,6 @@ function setString(name: string, value: string | number): SetAction { return new SetAction(name, value.toString()); } - - - /** * @summary action * @description Allows adding a variable by sending a key and value which is a reference to an asset. @@ -135,15 +130,6 @@ function setFromMetadata(name: string, value: string): SetFromMetadataAction { } const Variable = { - set, - setFloat, - setString, - setInteger, - setAssetReference, - setFromContext, - setFromMetadata -}; -export { set, setFloat, setString, @@ -151,5 +137,5 @@ export { setAssetReference, setFromContext, setFromMetadata, - Variable }; +export { set, setFloat, setString, setInteger, setAssetReference, setFromContext, setFromMetadata, Variable }; diff --git a/src/actions/variable/SetAction.ts b/src/actions/variable/SetAction.ts index b19ad57..a4a6128 100644 --- a/src/actions/variable/SetAction.ts +++ b/src/actions/variable/SetAction.ts @@ -1,6 +1,6 @@ -import {isString} from "../../internal/utils/dataStructureUtils.js"; +import { isString } from "../../internal/utils/dataStructureUtils.js"; import VariableAction from "./VariableAction.js"; -import {ExpressionQualifier} from "../../qualifiers/expression/ExpressionQualifier.js"; +import { ExpressionQualifier } from "../../qualifiers/expression/ExpressionQualifier.js"; /** * @description Sets a user-defined variable. @@ -9,10 +9,10 @@ import {ExpressionQualifier} from "../../qualifiers/expression/ExpressionQualifi * @see Visit {@link Actions.Variable|Variable} for an example */ class SetAction extends VariableAction { - constructor(name: string, value: number | string | string[] | number[] | ExpressionQualifier, wrapper = '!') { + constructor(name: string, value: number | string | string[] | number[] | ExpressionQualifier, wrapper = "!") { let finalValue: string | number | ExpressionQualifier; - const parsedValue = Array.isArray(value) ? value.join(':') : value; + const parsedValue = Array.isArray(value) ? value.join(":") : value; if (isString(parsedValue)) { /* @@ -21,15 +21,11 @@ class SetAction extends VariableAction { * The wrapper variable is needed because floats are passed as strings ('1.0') - in those case * we don't need to treat them as URL strings ($foo_!1.0!), but instead as foo_1.0 */ - finalValue = `${wrapper}${parsedValue - .replace(/,/g, '%2C') - .replace(/\//g, '%2F') - .replace(/!/g, '%21')}${wrapper}`; + finalValue = `${wrapper}${parsedValue.replace(/,/g, "%2C").replace(/\//g, "%2F").replace(/!/g, "%21")}${wrapper}`; } else { finalValue = parsedValue; } - // Required due to https://github.com/microsoft/TypeScript/issues/13029 /* istanbul ignore next */ super(name, finalValue); diff --git a/src/actions/variable/SetAssetReferenceAction.ts b/src/actions/variable/SetAssetReferenceAction.ts index 1cc8101..986fb05 100644 --- a/src/actions/variable/SetAssetReferenceAction.ts +++ b/src/actions/variable/SetAssetReferenceAction.ts @@ -11,8 +11,7 @@ class SetAssetReferenceAction extends VariableAction { // Required due to https://github.com/microsoft/TypeScript/issues/13029 /* istanbul ignore next */ - const parsedValue = value - .replace(/\//g, ':'); + const parsedValue = value.replace(/\//g, ":"); super(name, `ref:!${parsedValue}!`); } diff --git a/src/actions/variable/VariableAction.ts b/src/actions/variable/VariableAction.ts index b58aa5b..6b0471d 100644 --- a/src/actions/variable/VariableAction.ts +++ b/src/actions/variable/VariableAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {ExpressionQualifier} from "../../qualifiers/expression/ExpressionQualifier.js"; +import { Action } from "../../internal/Action.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { ExpressionQualifier } from "../../qualifiers/expression/ExpressionQualifier.js"; type TypeVariableValue = number | string | ExpressionQualifier; @@ -25,7 +25,7 @@ class VariableAction extends Action { /** * @description Converts the returned value to type float. */ - asFloat():this { + asFloat(): this { this.isFloat = true; return this; } @@ -40,18 +40,17 @@ class VariableAction extends Action { protected prepareQualifiers(): this { let qualifierValue; - if(this.isFloat) { - qualifierValue = new QualifierValue([this.value, 'to_f']).setDelimiter('_'); - }else if(this.isNumber) { - qualifierValue = new QualifierValue([this.value, 'to_i']).setDelimiter('_'); - }else{ + if (this.isFloat) { + qualifierValue = new QualifierValue([this.value, "to_f"]).setDelimiter("_"); + } else if (this.isNumber) { + qualifierValue = new QualifierValue([this.value, "to_i"]).setDelimiter("_"); + } else { qualifierValue = new QualifierValue(this.value); } this.addQualifier(new Qualifier(`$${this.name}`, qualifierValue)); return this; } - } export default VariableAction; diff --git a/src/actions/videoEdit.ts b/src/actions/videoEdit.ts index 349677a..37e27fb 100644 --- a/src/actions/videoEdit.ts +++ b/src/actions/videoEdit.ts @@ -1,8 +1,8 @@ -import TrimAction from './videoEdit/TrimAction.js'; -import ConcatenateAction from './videoEdit/ConcatenateAction.js'; +import TrimAction from "./videoEdit/TrimAction.js"; +import ConcatenateAction from "./videoEdit/ConcatenateAction.js"; import VolumeAction from "./videoEdit/VolumeAction.js"; -import {VideoSource} from "../qualifiers/source/sourceTypes/VideoSource.js"; -import {PreviewAction} from "./videoEdit/PreviewAction.js"; +import { VideoSource } from "../qualifiers/source/sourceTypes/VideoSource.js"; +import { PreviewAction } from "./videoEdit/PreviewAction.js"; /** * @summary action @@ -38,7 +38,7 @@ import {PreviewAction} from "./videoEdit/PreviewAction.js"; * .duration(5) * ) */ -function concatenate(source:VideoSource):ConcatenateAction{ +function concatenate(source: VideoSource): ConcatenateAction { return new ConcatenateAction(source); } @@ -47,7 +47,7 @@ function concatenate(source:VideoSource):ConcatenateAction{ * @description Trims a video (and discards the rest). * * Learn more: {@link https://cloudinary.com/documentation/video_trimming_and_concatenating#trimming_videos| - * Trimming videos} + * Trimming videos} * * @memberOf Actions.VideoEdit * @return {Actions.VideoEdit.TrimAction} @@ -64,7 +64,7 @@ function concatenate(source:VideoSource):ConcatenateAction{ * .duration(10) * ) */ -function trim(): TrimAction{ +function trim(): TrimAction { return new TrimAction(); } @@ -73,7 +73,7 @@ function trim(): TrimAction{ * @description Increases or decreases the volume by a percentage of the current volume. * * Learn more: {@link https://cloudinary.com/documentation/audio_transformations#adjust_the_audio_volume| - * Adjust the audio volume} + * Adjust the audio volume} * * @memberOf Actions.VideoEdit * @param {string | number} volumeValue The value of volume. The percentage change of volume (Range: -100 to 400). @@ -91,7 +91,7 @@ function trim(): TrimAction{ * video.videoEdit( volume('5db') ) // as decibels * video.videoEdit( volume(mute()) ) // if you prefer silence.. */ -function volume(volumeValue: string | number): VolumeAction{ +function volume(volumeValue: string | number): VolumeAction { return new VolumeAction(volumeValue); } @@ -100,7 +100,7 @@ function volume(volumeValue: string | number): VolumeAction{ * @description A video preview is a short excerpt from a video that can be used to engage your audience and help them select the video content that interests them. * * Learn more: {@link https://cloudinary.com/documentation/video_effects_and_enhancements#ai_based_video_preview| - * Create a video preview} + * Create a video preview} * * @memberOf Actions.VideoEdit * @return {Actions.VideoEdit.PreviewAction} @@ -117,11 +117,11 @@ function volume(volumeValue: string | number): VolumeAction{ * .maximumSegments(10) * ) */ -function preview(): PreviewAction{ +function preview(): PreviewAction { return new PreviewAction(); } export declare type videoEditType = VolumeAction | TrimAction | ConcatenateAction | PreviewAction; -const VideoEdit = {concatenate, trim, volume, preview}; -export {VideoEdit, concatenate, trim, volume, preview}; +const VideoEdit = { concatenate, trim, volume, preview }; +export { VideoEdit, concatenate, trim, volume, preview }; diff --git a/src/actions/videoEdit/ConcatenateAction.ts b/src/actions/videoEdit/ConcatenateAction.ts index ff1f4c0..78e3844 100644 --- a/src/actions/videoEdit/ConcatenateAction.ts +++ b/src/actions/videoEdit/ConcatenateAction.ts @@ -1,13 +1,13 @@ -import {Action} from "../../internal/Action.js"; -import {Transformation} from "../../transformation/Transformation.js"; -import {VideoSource} from "../../qualifiers/source/sourceTypes/VideoSource.js"; -import {ImageSource} from "../../qualifiers/source/sourceTypes/ImageSource.js"; -import {FetchSource} from "../../qualifiers/source/sourceTypes/FetchSource.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; -import {IConcatenateActionModel} from "../../internal/models/IConcatenateActionModel.js"; -import {ITransformationFromJson} from "../../internal/models/IHasFromJson.js"; -import {IVideoSourceModel} from "../../internal/models/IVideoSourceModel.js"; -import {createSourceFromModel} from "../../internal/models/createSourceFromModel.js"; +import { Action } from "../../internal/Action.js"; +import { Transformation } from "../../transformation/Transformation.js"; +import { VideoSource } from "../../qualifiers/source/sourceTypes/VideoSource.js"; +import { ImageSource } from "../../qualifiers/source/sourceTypes/ImageSource.js"; +import { FetchSource } from "../../qualifiers/source/sourceTypes/FetchSource.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; +import { IConcatenateActionModel } from "../../internal/models/IConcatenateActionModel.js"; +import { ITransformationFromJson } from "../../internal/models/IHasFromJson.js"; +import { IVideoSourceModel } from "../../internal/models/IVideoSourceModel.js"; +import { createSourceFromModel } from "../../internal/models/createSourceFromModel.js"; /** * @description Class for Concatenating another video. @@ -32,8 +32,8 @@ class ConcatenateAction extends Action { constructor(source: VideoSource | ImageSource | FetchSource) { super(); this._actionModel = { - actionType: 'concatenate', - source: source.toJson() as IVideoSourceModel + actionType: "concatenate", + source: source.toJson() as IVideoSourceModel, }; this.concatSource = source; @@ -78,10 +78,12 @@ class ConcatenateAction extends Action { getTransitionString(): string { const transTx = this._transition.getTransformation(); return [ - `e_transition,${this._transition.getOpenSourceString('l')}`, + `e_transition,${this._transition.getOpenSourceString("l")}`, transTx && transTx.toString(), - 'fl_layer_apply' - ].filter((a) => a).join('/'); + "fl_layer_apply", + ] + .filter((a) => a) + .join("/"); } /** @@ -109,15 +111,13 @@ class ConcatenateAction extends Action { const open = [ this._duration && `du_${this._duration}`, !this._transition && `fl_splice`, - `${this.concatSource.getOpenSourceString('l')}` - ].filter((a) => a).join(','); + `${this.concatSource.getOpenSourceString("l")}`, + ] + .filter((a) => a) + .join(","); // Calculate the open part - const close = [ - 'fl_layer_apply', - this._prepend && 'so_0' - ].filter((a) => a).join(','); - + const close = ["fl_layer_apply", this._prepend && "so_0"].filter((a) => a).join(","); // Calculate the Transition part let concatSourceTx; @@ -132,29 +132,25 @@ class ConcatenateAction extends Action { } // Put it all together, the transition is already part of the concatSourceTx - return [ - open, - concatSourceTx.toString(), - close - ].filter((a) => a).join('/'); + return [open, concatSourceTx.toString(), close].filter((a) => a).join("/"); } static fromJson(actionModel: IActionModel, transformationFromJson: ITransformationFromJson): ConcatenateAction { - const {source, transition, prepend, duration} = (actionModel as IConcatenateActionModel); + const { source, transition, prepend, duration } = actionModel as IConcatenateActionModel; const sourceInstance = createSourceFromModel(source, transformationFromJson) as ImageSource; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(sourceInstance); - if (transition){ + if (transition) { result.transition(VideoSource.fromJson(transition, transformationFromJson)); } - if (prepend){ + if (prepend) { result.prepend(); } - if (duration){ + if (duration) { result.duration(duration); } diff --git a/src/actions/videoEdit/PreviewAction.ts b/src/actions/videoEdit/PreviewAction.ts index 2316c5f..43009fd 100644 --- a/src/actions/videoEdit/PreviewAction.ts +++ b/src/actions/videoEdit/PreviewAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {toFloatAsString} from "../../internal/utils/toFloatAsString.js"; -import {IPreviewActionModel} from "../../internal/models/IPreviewActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { toFloatAsString } from "../../internal/utils/toFloatAsString.js"; +import { IPreviewActionModel } from "../../internal/models/IPreviewActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Class for creating a preview of a video @@ -18,7 +18,7 @@ class PreviewAction extends Action { constructor() { super(); this._actionModel = { - actionType: 'preview' + actionType: "preview", }; } @@ -57,27 +57,29 @@ class PreviewAction extends Action { toString(): string { return [ - 'e_preview', + "e_preview", this._duration && `duration_${toFloatAsString(this._duration)}`, this._maxSeg && `max_seg_${this._maxSeg}`, - this._minSeg && `min_seg_dur_${toFloatAsString(this._minSeg)}` - ].filter((a) => a).join(':'); + this._minSeg && `min_seg_dur_${toFloatAsString(this._minSeg)}`, + ] + .filter((a) => a) + .join(":"); } static fromJson(actionModel: IActionModel): PreviewAction { - const {duration, maximumSegments, minimumSegmentDuration} = (actionModel as IPreviewActionModel); + const { duration, maximumSegments, minimumSegmentDuration } = actionModel as IPreviewActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(); - if (duration != null){ + if (duration != null) { result.duration(duration); } - if (maximumSegments != null){ + if (maximumSegments != null) { result.maximumSegments(maximumSegments); } - if (minimumSegmentDuration != null){ + if (minimumSegmentDuration != null) { result.minimumSegmentDuration(minimumSegmentDuration); } @@ -85,4 +87,4 @@ class PreviewAction extends Action { } } -export {PreviewAction}; +export { PreviewAction }; diff --git a/src/actions/videoEdit/TrimAction.ts b/src/actions/videoEdit/TrimAction.ts index 4bac127..8c2221b 100644 --- a/src/actions/videoEdit/TrimAction.ts +++ b/src/actions/videoEdit/TrimAction.ts @@ -1,7 +1,7 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {ITrimActionModel} from "../../internal/models/ITrimActionModel.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { ITrimActionModel } from "../../internal/models/ITrimActionModel.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; /** * @description Class for shortening a video to the specified range. @@ -15,7 +15,7 @@ class TrimAction extends Action { constructor() { super(); this._actionModel = { - actionType: 'trimVideo' + actionType: "trimVideo", }; } @@ -26,8 +26,8 @@ class TrimAction extends Action { * @private * @return {string} */ - private parseVal(val: string|number): string | number { - return typeof val === 'number' ? val : val.replace('%', 'p'); + private parseVal(val: string | number): string | number { + return typeof val === "number" ? val : val.replace("%", "p"); } /** @@ -38,9 +38,9 @@ class TrimAction extends Action { * video length (for example, "30%" or "30p"). * @return {this} */ - startOffset(offset: string|number): this { + startOffset(offset: string | number): this { this._actionModel.startOffset = +offset; - return this.addQualifier(new Qualifier('so', this.parseVal(offset))); + return this.addQualifier(new Qualifier("so", this.parseVal(offset))); } /** @@ -51,9 +51,9 @@ class TrimAction extends Action { * video length (for example, "30%" or "30p"). * @return {this} */ - endOffset(offset: string|number): this { + endOffset(offset: string | number): this { this._actionModel.endOffset = +offset; - return this.addQualifier(new Qualifier('eo', this.parseVal(offset))); + return this.addQualifier(new Qualifier("eo", this.parseVal(offset))); } /** @@ -64,25 +64,25 @@ class TrimAction extends Action { * video length (for example, "30%" or "30p"). * @return {this} */ - duration(duration: string|number): this { + duration(duration: string | number): this { this._actionModel.duration = duration; - return this.addQualifier(new Qualifier('du', this.parseVal(duration))); + return this.addQualifier(new Qualifier("du", this.parseVal(duration))); } static fromJson(actionModel: IActionModel): TrimAction { - const {duration, startOffset, endOffset} = (actionModel as ITrimActionModel); + const { duration, startOffset, endOffset } = actionModel as ITrimActionModel; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created const result = new this(); - if (duration != null){ + if (duration != null) { result.duration(duration); } - if (startOffset != null){ + if (startOffset != null) { result.startOffset(startOffset); } - if (endOffset != null){ + if (endOffset != null) { result.endOffset(endOffset); } diff --git a/src/actions/videoEdit/VolumeAction.ts b/src/actions/videoEdit/VolumeAction.ts index 0bc07d0..577234a 100644 --- a/src/actions/videoEdit/VolumeAction.ts +++ b/src/actions/videoEdit/VolumeAction.ts @@ -1,11 +1,11 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {IActionModel} from "../../internal/models/IActionModel.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { IActionModel } from "../../internal/models/IActionModel.js"; import { IVolumeActionModel, IVolumeByPercentModel, - IVolumeValueModel + IVolumeValueModel, } from "../../internal/models/IVolumeActionModel.js"; /** @@ -19,29 +19,28 @@ class VolumeAction extends Action { constructor(volumeValue: string | number) { super(); - let volumeValueModel: unknown = {mode: 'mute'}; - if (volumeValue !== 'mute') { + let volumeValueModel: unknown = { mode: "mute" }; + if (volumeValue !== "mute") { volumeValueModel = { - mode: (`${volumeValue}`.endsWith('db') ? 'decibels' : 'percent'), - value: +(`${volumeValue}`.replace('db', '')) + mode: `${volumeValue}`.endsWith("db") ? "decibels" : "percent", + value: +`${volumeValue}`.replace("db", ""), }; } this._actionModel = { - actionType: 'volume', - volumeValue: volumeValueModel as IVolumeValueModel + actionType: "volume", + volumeValue: volumeValueModel as IVolumeValueModel, }; - const qualifierValue = new QualifierValue(['volume', volumeValue]).setDelimiter(':'); - this.addQualifier(new Qualifier('e', qualifierValue)); + const qualifierValue = new QualifierValue(["volume", volumeValue]).setDelimiter(":"); + this.addQualifier(new Qualifier("e", qualifierValue)); } static fromJson(actionModel: IActionModel): VolumeAction { - const {volumeValue} = (actionModel as IVolumeActionModel); - const {mode} = volumeValue; - const value = mode === 'mute' ? mode : (volumeValue as IVolumeByPercentModel).value; - const suffix = (mode === 'mute' || mode === "percent") ? '' : 'db'; - + const { volumeValue } = actionModel as IVolumeActionModel; + const { mode } = volumeValue; + const value = mode === "mute" ? mode : (volumeValue as IVolumeByPercentModel).value; + const suffix = mode === "mute" || mode === "percent" ? "" : "db"; // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel]) // This allows the inheriting classes to determine the class to be created diff --git a/src/backwards/condition.ts b/src/backwards/condition.ts index 48d5073..13d9d00 100644 --- a/src/backwards/condition.ts +++ b/src/backwards/condition.ts @@ -1,4 +1,4 @@ -import Expression from './expression.js'; +import Expression from "./expression.js"; /** * Represents a transformation condition. @@ -24,7 +24,7 @@ import Expression from './expression.js'; * */ class Condition extends Expression { - constructor(conditionStr:string) { + constructor(conditionStr: string) { super(conditionStr); } @@ -34,7 +34,7 @@ class Condition extends Expression { * @param {string|number} value the right hand side value * @return {Condition} this condition */ - height(operator: string, value: string|number) { + height(operator: string, value: string | number) { return this.predicate("h", operator, value); } @@ -44,7 +44,7 @@ class Condition extends Expression { * @param {string|number} value the right hand side value * @return {Condition} this condition */ - width(operator: string, value: string|number) { + width(operator: string, value: string | number) { return this.predicate("w", operator, value); } @@ -54,7 +54,7 @@ class Condition extends Expression { * @param {string|number} value the right hand side value * @return {Condition} this condition */ - aspectRatio(operator: string, value: string|number) { + aspectRatio(operator: string, value: string | number) { return this.predicate("ar", operator, value); } @@ -64,7 +64,7 @@ class Condition extends Expression { * @param {string|number} value the right hand side value * @return {Condition} this condition */ - pageCount(operator: string, value: string|number) { + pageCount(operator: string, value: string | number) { return this.predicate("pc", operator, value); } @@ -74,7 +74,7 @@ class Condition extends Expression { * @param {string|number} value the right hand side value * @return {Condition} this condition */ - faceCount(operator: string, value: string|number) { + faceCount(operator: string, value: string | number) { return this.predicate("fc", operator, value); } @@ -84,7 +84,7 @@ class Condition extends Expression { * @param {string|number} value the right hand side value * @return {Condition} this condition */ - duration(operator: string, value: string|number) { + duration(operator: string, value: string | number) { return this.predicate("du", operator, value); } @@ -94,7 +94,7 @@ class Condition extends Expression { * @param {string|number} value the right hand side value * @return {Condition} this condition */ - initialDuration(operator: string, value: string|number) { + initialDuration(operator: string, value: string | number) { return this.predicate("idu", operator, value); } } diff --git a/src/backwards/configuration.ts b/src/backwards/configuration.ts index 12ff91e..4386ac8 100644 --- a/src/backwards/configuration.ts +++ b/src/backwards/configuration.ts @@ -1,11 +1,10 @@ -import { cloneDeep } from '../internal/utils/cloneDeep.js'; -import {isObject} from "./utils/isObject.js"; +import { cloneDeep } from "../internal/utils/cloneDeep.js"; +import { isObject } from "./utils/isObject.js"; /** * Class for defining account configuration options. * Depends on 'utils' */ - /** * Assign values from sources if they are not defined in the destination. * Once a value is set it does not change @@ -15,8 +14,8 @@ import {isObject} from "./utils/isObject.js"; * @param {...Object} source - the source object(s) to assign defaults from * @return {Object} destination after it was modified */ -const useDefaultValues = (destination:{}, ...sources: object[])=>{ - return sources.reduce(function(dest, source) { +const useDefaultValues = (destination: {}, ...sources: object[]) => { + return sources.reduce(function (dest, source) { let key, value; for (key in source) { // @ts-ignore @@ -70,7 +69,7 @@ class Configuration { * @return {Configuration} * */ - set(name:string|boolean, value:any) { + set(name: string | boolean, value: any) { // @ts-ignore this.configuration[name] = value; return this; @@ -82,11 +81,11 @@ class Configuration { * @param {string} name - the name of the item to set * @return {*} the configuration item */ - get(name:string) { + get(name: string) { return this.configuration[name]; } - merge(config:any) { + merge(config: any) { Object.assign(this.configuration, cloneDeep(config)); return this; } @@ -100,11 +99,14 @@ class Configuration { */ fromDocument() { var el, i, len, meta_elements; - meta_elements = typeof document !== "undefined" && document !== null ? document.querySelectorAll('meta[name^="cloudinary_"]') : void 0; + meta_elements = + typeof document !== "undefined" && document !== null + ? document.querySelectorAll('meta[name^="cloudinary_"]') + : void 0; if (meta_elements) { for (i = 0, len = meta_elements.length; i < len; i++) { el = meta_elements[i]; - this.configuration[el.getAttribute('name').replace('cloudinary_', '')] = el.getAttribute('content'); + this.configuration[el.getAttribute("name").replace("cloudinary_", "")] = el.getAttribute("content"); } } return this; @@ -119,30 +121,30 @@ class Configuration { */ fromEnvironment() { var cloudinary_url, query, uri, uriRegex; - if(typeof process !== "undefined" && process !== null && process.env && process.env.CLOUDINARY_URL ){ + if (typeof process !== "undefined" && process !== null && process.env && process.env.CLOUDINARY_URL) { cloudinary_url = process.env.CLOUDINARY_URL; uriRegex = /cloudinary:\/\/(?:(\w+)(?:\:([\w-]+))?@)?([\w\.-]+)(?:\/([^?]*))?(?:\?(.+))?/; uri = uriRegex.exec(cloudinary_url); if (uri) { if (uri[3] != null) { - this.configuration['cloud_name'] = uri[3]; + this.configuration["cloud_name"] = uri[3]; } if (uri[1] != null) { - this.configuration['api_key'] = uri[1]; + this.configuration["api_key"] = uri[1]; } if (uri[2] != null) { - this.configuration['api_secret'] = uri[2]; + this.configuration["api_secret"] = uri[2]; } if (uri[4] != null) { - this.configuration['private_cdn'] = uri[4] != null; + this.configuration["private_cdn"] = uri[4] != null; } if (uri[4] != null) { - this.configuration['secure_distribution'] = uri[4]; + this.configuration["secure_distribution"] = uri[4]; } query = uri[5]; if (query != null) { - query.split('&').forEach(value=>{ - let [k, v] = value.split('='); + query.split("&").forEach((value) => { + let [k, v] = value.split("="); if (v == null) { // @ts-ignore v = true; @@ -169,12 +171,12 @@ class Configuration { * @see {@link fromEnvironment} for initialization using environment variables * @see {@link fromDocument} for initialization using HTML meta tags */ - config(new_config:string, new_value:string) { + config(new_config: string, new_value: string) { switch (false) { case new_value === void 0: this.set(new_config, new_value); return this.configuration; - case typeof new_config != 'string': + case typeof new_config != "string": return this.get(new_config); case !isObject(new_config): this.merge(new_config); @@ -193,14 +195,18 @@ class Configuration { toOptions() { return cloneDeep(this.configuration); } - } const DEFAULT_CONFIGURATION_PARAMS = { - responsive_class: 'cld-responsive', + responsive_class: "cld-responsive", responsive_use_breakpoints: true, round_dpr: true, - secure: (typeof window !== "undefined" && window !== null ? window.location ? window.location.protocol : void 0 : void 0) === 'https:' + secure: + (typeof window !== "undefined" && window !== null + ? window.location + ? window.location.protocol + : void 0 + : void 0) === "https:", }; export const CONFIG_PARAMS = [ @@ -228,7 +234,7 @@ export const CONFIG_PARAMS = [ "use_root_path", "version", "externalLibraries", - "max_timeout_ms" + "max_timeout_ms", ]; export default Configuration; diff --git a/src/backwards/consts.ts b/src/backwards/consts.ts index 7e01943..e4d8f7b 100644 --- a/src/backwards/consts.ts +++ b/src/backwards/consts.ts @@ -1,17 +1,17 @@ export const LEGACY_CONDITIONAL_OPERATORS = { - "=": 'eq', - "!=": 'ne', - "<": 'lt', - ">": 'gt', - "<=": 'lte', - ">=": 'gte', - "&&": 'and', - "||": 'or', + "=": "eq", + "!=": "ne", + "<": "lt", + ">": "gt", + "<=": "lte", + ">=": "gte", + "&&": "and", + "||": "or", "*": "mul", "/": "div", "+": "add", "-": "sub", - "^": "pow" + "^": "pow", }; export const CF_SHARED_CDN = "d3jpl91pxevbkh.cloudfront.net"; @@ -20,30 +20,30 @@ export const AKAMAI_SHARED_CDN = "res.cloudinary.com"; export const SHARED_CDN = AKAMAI_SHARED_CDN; export const LEGACY_PREDEFINED_VARS = { - "aspect_ratio": "ar", - "aspectRatio": "ar", - "current_page": "cp", - "currentPage": "cp", - "duration": "du", - "face_count": "fc", - "faceCount": "fc", - "height": "h", - "initial_aspect_ratio": "iar", - "initial_height": "ih", - "initial_width": "iw", - "initialAspectRatio": "iar", - "initialHeight": "ih", - "initialWidth": "iw", - "initial_duration": "idu", - "initialDuration": "idu", - "page_count": "pc", - "page_x": "px", - "page_y": "py", - "pageCount": "pc", - "pageX": "px", - "pageY": "py", - "tags": "tags", - "width": "w" + aspect_ratio: "ar", + aspectRatio: "ar", + current_page: "cp", + currentPage: "cp", + duration: "du", + face_count: "fc", + faceCount: "fc", + height: "h", + initial_aspect_ratio: "iar", + initial_height: "ih", + initial_width: "iw", + initialAspectRatio: "iar", + initialHeight: "ih", + initialWidth: "iw", + initial_duration: "idu", + initialDuration: "idu", + page_count: "pc", + page_x: "px", + page_y: "py", + pageCount: "pc", + pageX: "px", + pageY: "py", + tags: "tags", + width: "w", }; export const NUMBER_PATTERN = "([0-9]*)\\.([0-9]+)|([0-9]+)"; @@ -55,6 +55,6 @@ export const LAYER_KEYWORD_PARAMS = { font_weight: "normal", font_style: "normal", text_decoration: "none", - text_align: '', - stroke: "none" + text_align: "", + stroke: "none", }; diff --git a/src/backwards/createCloudinaryLegacyURL.ts b/src/backwards/createCloudinaryLegacyURL.ts index 449794a..d0b21f2 100644 --- a/src/backwards/createCloudinaryLegacyURL.ts +++ b/src/backwards/createCloudinaryLegacyURL.ts @@ -1,9 +1,9 @@ -import {stringOrNumber, LegacyITransforamtionOptions} from "../types/types.js"; -import {generateTransformationString} from "./generateTransformationString.js"; -import {finalize_resource_type} from "./utils/finalizeResourceType.js"; -import {finalize_source} from "./utils/finalize_source.js"; -import {unsigned_url_prefix} from "./utils/unsigned_url_prefix.js"; -import { cloneDeep } from '../internal/utils/cloneDeep.js'; +import { stringOrNumber, LegacyITransforamtionOptions } from "../types/types.js"; +import { generateTransformationString } from "./generateTransformationString.js"; +import { finalize_resource_type } from "./utils/finalizeResourceType.js"; +import { finalize_source } from "./utils/finalize_source.js"; +import { unsigned_url_prefix } from "./utils/unsigned_url_prefix.js"; +import { cloneDeep } from "../internal/utils/cloneDeep.js"; export function createCloudinaryLegacyURL(public_id: string, transformationOptions: LegacyITransforamtionOptions) { // Path format @@ -15,10 +15,10 @@ export function createCloudinaryLegacyURL(public_id: string, transformationOptio let source_to_sign; let type = transformationOptions.type; - let resource_type = transformationOptions.resource_type || 'image' + let resource_type = transformationOptions.resource_type || "image"; let version: stringOrNumber = transformationOptions.version; - const force_version = typeof transformationOptions.force_version === 'boolean' ? transformationOptions.force_version : true - + const force_version = + typeof transformationOptions.force_version === "boolean" ? transformationOptions.force_version : true; const long_url_signature = !!transformationOptions.long_url_signature; const format = transformationOptions.format; @@ -34,13 +34,13 @@ export function createCloudinaryLegacyURL(public_id: string, transformationOptio const cdn_subdomain = transformationOptions.cdn_subdomain; const secure_cdn_subdomain = transformationOptions.secure_cdn_subdomain; - const cname = transformationOptions.cname - const shorten = transformationOptions.shorten - const sign_url = transformationOptions.sign_url - const api_secret = transformationOptions.api_secret - const url_suffix = transformationOptions.url_suffix - const use_root_path = transformationOptions.use_root_path - const auth_token = transformationOptions.auth_token + const cname = transformationOptions.cname; + const shorten = transformationOptions.shorten; + const sign_url = transformationOptions.sign_url; + const api_secret = transformationOptions.api_secret; + const url_suffix = transformationOptions.url_suffix; + const use_root_path = transformationOptions.use_root_path; + const auth_token = transformationOptions.auth_token; const preloaded = /^(image|raw)\/([a-z0-9_]+)\/v(\d+)\/([^#]+)$/.exec(public_id); @@ -61,7 +61,13 @@ export function createCloudinaryLegacyURL(public_id: string, transformationOptio [resource_type, type] = finalize_resource_type(resource_type, type, url_suffix, use_root_path, shorten); [public_id, source_to_sign] = finalize_source(public_id, format, url_suffix); - if (version == null && force_version && source_to_sign.indexOf("/") >= 0 && !source_to_sign.match(/^v[0-9]+/) && !source_to_sign.match(/^https?:\//)) { + if ( + version == null && + force_version && + source_to_sign.indexOf("/") >= 0 && + !source_to_sign.match(/^v[0-9]+/) && + !source_to_sign.match(/^https?:\//) + ) { version = 1; } if (version != null) { @@ -70,18 +76,19 @@ export function createCloudinaryLegacyURL(public_id: string, transformationOptio version = null; } - const transformation = generateTransformationString(cloneDeep(transformationOptions)).replace(/([^:])\/\//g, '$1/');; + const transformation = generateTransformationString(cloneDeep(transformationOptions)).replace(/([^:])\/\//g, "$1/"); if (sign_url && !auth_token) { - let to_sign = [transformation, source_to_sign].filter(function (part) { - return (part != null) && part !== ''; - }).join('/'); + let to_sign = [transformation, source_to_sign] + .filter(function (part) { + return part != null && part !== ""; + }) + .join("/"); try { for (let i = 0; to_sign !== decodeURIComponent(to_sign) && i < 10; i++) { to_sign = decodeURIComponent(to_sign); } // eslint-disable-next-line no-empty - } catch (error) { - } + } catch (error) {} // No support for Auth Token // const shasum = crypto.createHash(long_url_signature ? 'sha256' : 'sha1'); @@ -100,9 +107,12 @@ export function createCloudinaryLegacyURL(public_id: string, transformationOptio secure_distribution ); - const resultUrl = [prefix, resource_type, type, transformation, version, public_id].filter(function (part) { - return (part != null) && part !== ''; - }).join('/').replace(' ', '%20'); + const resultUrl = [prefix, resource_type, type, transformation, version, public_id] + .filter(function (part) { + return part != null && part !== ""; + }) + .join("/") + .replace(" ", "%20"); return resultUrl; } diff --git a/src/backwards/expression.ts b/src/backwards/expression.ts index 737d4f7..164b22b 100644 --- a/src/backwards/expression.ts +++ b/src/backwards/expression.ts @@ -22,7 +22,7 @@ class Expression { * Convenience constructor method * @function Expression.new */ - static new(expressionStr?:string) { + static new(expressionStr?: string) { return new this(expressionStr); } @@ -32,7 +32,7 @@ class Expression { * @param {string} expression a expression, e.g. "w gt 100", "width_gt_100", "width > 100" * @return {string} the normalized form of the value expression, e.g. "w_gt_100" */ - static normalize(expression:string | number) { + static normalize(expression: string | number) { var operators, operatorsPattern, operatorsReplaceRE, predefinedVarsPattern, predefinedVarsReplaceRE; if (expression == null) { return expression; @@ -44,15 +44,17 @@ class Expression { operatorsPattern = "((" + operators + ")(?=[ _]))"; operatorsReplaceRE = new RegExp(operatorsPattern, "g"); // @ts-ignore - expression = expression.replace(operatorsReplaceRE, match => OPERATORS[match]); + expression = expression.replace(operatorsReplaceRE, (match) => OPERATORS[match]); // predefined variables predefinedVarsPattern = "(" + Object.keys(PREDEFINED_VARS).join("|") + ")"; predefinedVarsReplaceRE = new RegExp(predefinedVarsPattern, "g"); // @ts-ignore - expression = expression.replace(predefinedVarsReplaceRE, (match, p1, offset) => (expression[offset - 1] === '$' ? match : PREDEFINED_VARS[match])); + expression = expression.replace(predefinedVarsReplaceRE, (match, p1, offset) => + expression[offset - 1] === "$" ? match : PREDEFINED_VARS[match] + ); - return expression.replace(/[ _]+/g, '_'); + return expression.replace(/[ _]+/g, "_"); } /** @@ -80,7 +82,7 @@ class Expression { * @param {Transformation} the parent transformation * @return {Expression} this expression */ - setParent(parent:any) { + setParent(parent: any) { this.parent = parent; return this; } @@ -131,7 +133,7 @@ class Expression { * @param {string|number} value the right hand side value * @return {Expression} this expression */ - height(operator: string, value: string|number) { + height(operator: string, value: string | number) { return this.predicate("h", operator, value); } @@ -141,7 +143,7 @@ class Expression { * @param {string|number} value the right hand side value * @return {Expression} this expression */ - width(operator: string, value: string|number) { + width(operator: string, value: string | number) { return this.predicate("w", operator, value); } @@ -151,7 +153,7 @@ class Expression { * @param {string|number} value the right hand side value * @return {Expression} this expression */ - aspectRatio(operator: string, value: string|number) { + aspectRatio(operator: string, value: string | number) { return this.predicate("ar", operator, value); } @@ -161,7 +163,7 @@ class Expression { * @param {string|number} value the right hand side value * @return {Expression} this expression */ - pageCount(operator: string, value: string|number) { + pageCount(operator: string, value: string | number) { return this.predicate("pc", operator, value); } @@ -171,18 +173,18 @@ class Expression { * @param {string|number} value the right hand side value * @return {Expression} this expression */ - faceCount(operator: string, value: string|number) { + faceCount(operator: string, value: string | number) { return this.predicate("fc", operator, value); } - value(value:string|number) { + value(value: string | number) { this.expressions.push(value); return this; } /** */ - static variable(name:string, value:string|number) { + static variable(name: string, value: string | number) { return new this(name).value(value); } @@ -281,21 +283,20 @@ class Expression { static pageY() { return new this("pageY"); } - } /** * @internal */ const OPERATORS = { - "=": 'eq', - "!=": 'ne', - "<": 'lt', - ">": 'gt', - "<=": 'lte', - ">=": 'gte', - "&&": 'and', - "||": 'or', + "=": "eq", + "!=": "ne", + "<": "lt", + ">": "gt", + "<=": "lte", + ">=": "gte", + "&&": "and", + "||": "or", "*": "mul", "/": "div", "+": "add", @@ -307,31 +308,31 @@ const OPERATORS = { * @internal */ const PREDEFINED_VARS = { - "aspect_ratio": "ar", - "aspectRatio": "ar", - "current_page": "cp", - "currentPage": "cp", + aspect_ratio: "ar", + aspectRatio: "ar", + current_page: "cp", + currentPage: "cp", "preview:duration": "preview:duration", - "duration": "du", - "face_count": "fc", - "faceCount": "fc", - "height": "h", - "initial_aspect_ratio": "iar", - "initial_duration": "idu", - "initial_height": "ih", - "initial_width": "iw", - "initialAspectRatio": "iar", - "initialDuration": "idu", - "initialHeight": "ih", - "initialWidth": "iw", - "page_count": "pc", - "page_x": "px", - "page_y": "py", - "pageCount": "pc", - "pageX": "px", - "pageY": "py", - "tags": "tags", - "width": "w" + duration: "du", + face_count: "fc", + faceCount: "fc", + height: "h", + initial_aspect_ratio: "iar", + initial_duration: "idu", + initial_height: "ih", + initial_width: "iw", + initialAspectRatio: "iar", + initialDuration: "idu", + initialHeight: "ih", + initialWidth: "iw", + page_count: "pc", + page_x: "px", + page_y: "py", + pageCount: "pc", + pageX: "px", + pageY: "py", + tags: "tags", + width: "w", }; /** diff --git a/src/backwards/generateTransformationString.ts b/src/backwards/generateTransformationString.ts index 22dcfab..cf5714a 100644 --- a/src/backwards/generateTransformationString.ts +++ b/src/backwards/generateTransformationString.ts @@ -1,21 +1,18 @@ // eslint-disable @typescript-eslint/ban-ts-comment -import {LegacyITransforamtionOptions} from "../types/types.js"; -import {processLayer} from "./transformationProcessing/processLayer.js"; -import {process_if} from "./transformationProcessing/processIf.js"; -import {toArray} from "./utils/toArray.js"; -import {processRadius} from "./transformationProcessing/processRadius.js"; -import {isObject} from "./utils/isObject.js"; -import {processCustomFunction} from "./transformationProcessing/processCustomFunction.js"; -import {processCustomPreFunction} from "./transformationProcessing/processCustomPreFunction.js"; -import {splitRange} from "./utils/splitRange.js"; -import {legacyNormalizeExpression} from "./utils/legacyNormalizeExpression.js"; -import {normRangeValues} from "./utils/norm_range_values.js"; -import {processVideoParams} from "./transformationProcessing/processVideoParams.js"; +import { LegacyITransforamtionOptions } from "../types/types.js"; +import { processLayer } from "./transformationProcessing/processLayer.js"; +import { process_if } from "./transformationProcessing/processIf.js"; +import { toArray } from "./utils/toArray.js"; +import { processRadius } from "./transformationProcessing/processRadius.js"; +import { isObject } from "./utils/isObject.js"; +import { processCustomFunction } from "./transformationProcessing/processCustomFunction.js"; +import { processCustomPreFunction } from "./transformationProcessing/processCustomPreFunction.js"; +import { splitRange } from "./utils/splitRange.js"; +import { legacyNormalizeExpression } from "./utils/legacyNormalizeExpression.js"; +import { normRangeValues } from "./utils/norm_range_values.js"; +import { processVideoParams } from "./transformationProcessing/processVideoParams.js"; import Transformation from "./transformation.js"; -import {processDpr} from "./transformationProcessing/processDpr.js"; - - - +import { processDpr } from "./transformationProcessing/processDpr.js"; /** * Things dropped @@ -29,11 +26,11 @@ import {processDpr} from "./transformationProcessing/processDpr.js"; * @param transformationOptions */ export function generateTransformationString(transformationOptions: LegacyITransforamtionOptions): string { - if (typeof transformationOptions === 'string') { + if (typeof transformationOptions === "string") { return transformationOptions; } - if (transformationOptions instanceof Transformation){ + if (transformationOptions instanceof Transformation) { return transformationOptions.toString(); } @@ -41,7 +38,11 @@ export function generateTransformationString(transformationOptions: LegacyITrans return transformationOptions .map((singleTransformation) => { return generateTransformationString(singleTransformation); - }).filter((a) => { return a;}).join('/'); + }) + .filter((a) => { + return a; + }) + .join("/"); } // let responsive_width = consumeOption(transformationOptions, "responsive_width", config().responsive_width); @@ -53,10 +54,11 @@ export function generateTransformationString(transformationOptions: LegacyITrans const hasLayer = transformationOptions.overlay || transformationOptions.underlay; const crop = transformationOptions.crop; const angle = toArray(transformationOptions.angle).join("."); - const background = (transformationOptions.background || '').replace(/^#/, "rgb:"); - const color = (transformationOptions.color || '').replace(/^#/, "rgb:"); - const flags = (toArray(transformationOptions.flags || [])).join('.'); - const dpr = transformationOptions.dpr === undefined ? transformationOptions.dpr : processDpr(transformationOptions.dpr); + const background = (transformationOptions.background || "").replace(/^#/, "rgb:"); + const color = (transformationOptions.color || "").replace(/^#/, "rgb:"); + const flags = toArray(transformationOptions.flags || []).join("."); + const dpr = + transformationOptions.dpr === undefined ? transformationOptions.dpr : processDpr(transformationOptions.dpr); const overlay = processLayer(transformationOptions.overlay); const radius = processRadius(transformationOptions.radius); @@ -74,7 +76,6 @@ export function generateTransformationString(transformationOptions: LegacyITrans // TODO, Do we need this? const no_html_sizes = hasLayer || angle || crop === "fit" || crop === "limit"; - if (size) { const [sizeWidth, sizeHeight] = size.split("x"); width = sizeWidth; @@ -84,7 +85,6 @@ export function generateTransformationString(transformationOptions: LegacyITrans height = transformationOptions.height; } - if (width && (width.toString().indexOf("auto") === 0 || no_html_sizes || parseFloat(width.toString()) < 1)) { delete transformationOptions.width; } @@ -92,47 +92,50 @@ export function generateTransformationString(transformationOptions: LegacyITrans delete transformationOptions.height; } - // Is any child transformation an object? - const isAnyChildAnObject = childTransformations.some((transformation: LegacyITransforamtionOptions) => typeof transformation === 'object'); + const isAnyChildAnObject = childTransformations.some( + (transformation: LegacyITransforamtionOptions) => typeof transformation === "object" + ); // If array of objects, or array of strings? if (isAnyChildAnObject) { - childTransformations = childTransformations.map((transformation: LegacyITransforamtionOptions) => { - if (isObject(transformation)) { - return generateTransformationString(transformation); - } else { - return generateTransformationString({transformation}); - } - }).filter((a: LegacyITransforamtionOptions) => a); - + childTransformations = childTransformations + .map((transformation: LegacyITransforamtionOptions) => { + if (isObject(transformation)) { + return generateTransformationString(transformation); + } else { + return generateTransformationString({ transformation }); + } + }) + .filter((a: LegacyITransforamtionOptions) => a); } else { namedTransformations = childTransformations.join("."); childTransformations = []; // Reset child transfomrations } - if (Array.isArray(effect)) { effect = effect.join(":"); } else if (isObject(effect)) { - effect = Object.entries(effect).map( - ([key, value]) => `${key}:${value}` - ); + effect = Object.entries(effect).map(([key, value]) => `${key}:${value}`); } let border = transformationOptions.border; if (isObject(border)) { - border = `${border.width != null ? border.width : 2}px_solid_${(border.color != null ? border.color : "black").replace(/^#/, 'rgb:')}`; + border = `${border.width != null ? border.width : 2}px_solid_${(border.color != null + ? border.color + : "black" + ).replace(/^#/, "rgb:")}`; } else { // @ts-ignore - if (/^\d+$/.exec(border)) { // fallback to html border attributes + if (/^\d+$/.exec(border)) { + // fallback to html border attributes transformationOptions.border = border; border = void 0; } } if (Array.isArray(fps)) { - fps = fps.join('-'); + fps = fps.join("-"); } // ocr(value) { @@ -179,48 +182,51 @@ export function generateTransformationString(transformationOptions: LegacyITrans so: normRangeValues(splitRange(transformationOptions.offset)[0]), sp: transformationOptions.streaming_profile, vc: processVideoParams(transformationOptions.video_codec), - vs: transformationOptions.video_sampling + vs: transformationOptions.video_sampling, }; - // We can accept variables in here transformationOptions, or in here transformationOptions.variables const variables = Object.entries(transformationOptions) - .filter(([key, value]) => key.startsWith('$')) + .filter(([key, value]) => key.startsWith("$")) .map(([key, value]) => { // delete transformationOptions[key]; // Delete the variables, so we don't add them twice return `${key}_${legacyNormalizeExpression(value)}`; - }).sort().concat( + }) + .sort() + .concat( // @ts-ignore (transformationOptions.variables || []).map(([name, value]) => `${name}_${legacyNormalizeExpression(value)}`) - ).join(','); - + ) + .join(","); // Clean up! const urlImageTransfomrations = Object.entries(urlParams) .filter(([key, value]) => { - if (typeof value === 'undefined' || value === null) { + if (typeof value === "undefined" || value === null) { return false; } - if (typeof value === 'string' && value.length === 0) { + if (typeof value === "string" && value.length === 0) { return false; } if (Array.isArray(value) && value.length === 0) { - return false + return false; } return true; }) .map(([key, value]) => `${key}_${value}`) .sort() - .join(','); + .join(","); const finalTransformationString = [ ifValue, variables, urlImageTransfomrations, - transformationOptions.raw_transformation - ].filter((a) => a).join(","); + transformationOptions.raw_transformation, + ] + .filter((a) => a) + .join(","); if (finalTransformationString) { childTransformations.push(finalTransformationString); @@ -229,4 +235,3 @@ export function generateTransformationString(transformationOptions: LegacyITrans // console.log(childTransformations); return childTransformations.join("/"); } - diff --git a/src/backwards/legacyLayer/fetchlayer.ts b/src/backwards/legacyLayer/fetchlayer.ts index 0e96a90..703837c 100644 --- a/src/backwards/legacyLayer/fetchlayer.ts +++ b/src/backwards/legacyLayer/fetchlayer.ts @@ -1,7 +1,6 @@ -import Layer from './layer.js'; -import {isString} from "../../internal/utils/dataStructureUtils.js"; -import {base64Encode} from "../../internal/utils/base64Encode.js"; - +import Layer from "./layer.js"; +import { isString } from "../../internal/utils/dataStructureUtils.js"; +import { base64Encode } from "../../internal/utils/base64Encode.js"; class FetchLayer extends Layer { /** @@ -10,7 +9,7 @@ class FetchLayer extends Layer { * @param {Object|string} options - layer parameters or a url * @param {string} options.url the url of the image to fetch */ - constructor(options:any) { + constructor(options: any) { super(options); if (isString(options)) { this.options.url = options; @@ -19,7 +18,7 @@ class FetchLayer extends Layer { } } - url(url:string) { + url(url: string) { this.options.url = url; return this; } @@ -32,7 +31,6 @@ class FetchLayer extends Layer { toString() { return `fetch:${base64Encode(this.options.url)}`; } - } export default FetchLayer; diff --git a/src/backwards/legacyLayer/layer.ts b/src/backwards/legacyLayer/layer.ts index 0ed5889..7379e9d 100644 --- a/src/backwards/legacyLayer/layer.ts +++ b/src/backwards/legacyLayer/layer.ts @@ -1,4 +1,4 @@ -import {snakeCase} from "../utils/snakeCase.js"; +import { snakeCase } from "../utils/snakeCase.js"; class Layer { protected options: { @@ -26,28 +26,28 @@ class Layer { * @constructor Layer * @param {Object} options - layer parameters */ - constructor(options?:{}) { + constructor(options?: {}) { this.options = {}; if (options != null) { ["resourceType", "type", "publicId", "format"].forEach((key) => { var ref; // @ts-ignore - return this.options[key] = (ref = options[key]) != null ? ref : options[snakeCase(key)]; + return (this.options[key] = (ref = options[key]) != null ? ref : options[snakeCase(key)]); }); } } - resourceType(value:string) { + resourceType(value: string) { this.options.resourceType = value; return this; } - type(value:string) { + type(value: string) { this.options.type = value; return this; } - publicId(value:string) { + publicId(value: string) { this.options.publicId = value; return this; } @@ -75,7 +75,7 @@ class Layer { } } - format(value:any): this | void { + format(value: any): this | void { this.options.format = value; return this; } @@ -85,7 +85,7 @@ class Layer { * @function Layer#toString */ toString() { - let components:string[]=[]; + let components: string[] = []; if (this.options.publicId == null) { throw "Must supply publicId"; } @@ -96,13 +96,12 @@ class Layer { components.push(this.options.type); } components.push(this.getFullPublicId()); - return components.filter(x => !!x).join(":"); + return components.filter((x) => !!x).join(":"); } clone() { return new Layer(this.options); } - } export default Layer; diff --git a/src/backwards/legacyLayer/subtitleslayer.ts b/src/backwards/legacyLayer/subtitleslayer.ts index f5aa91d..d4ea47d 100644 --- a/src/backwards/legacyLayer/subtitleslayer.ts +++ b/src/backwards/legacyLayer/subtitleslayer.ts @@ -1,4 +1,4 @@ -import TextLayer from './textlayer.js'; +import TextLayer from "./textlayer.js"; class SubtitlesLayer extends TextLayer { /** @@ -10,6 +10,5 @@ class SubtitlesLayer extends TextLayer { super(options); this.options.resourceType = "subtitles"; } - } export default SubtitlesLayer; diff --git a/src/backwards/legacyLayer/textlayer.ts b/src/backwards/legacyLayer/textlayer.ts index c951636..1233c86 100644 --- a/src/backwards/legacyLayer/textlayer.ts +++ b/src/backwards/legacyLayer/textlayer.ts @@ -1,98 +1,113 @@ -import Layer from './layer.js'; -import {snakeCase} from "../utils/snakeCase.js"; -import {isEmpty} from "../utils/isEmpty.js"; -import {smartEscape} from "../utils/smartEscape.js"; -import {isNumberLike} from "../utils/isNumberLike.js"; +import Layer from "./layer.js"; +import { snakeCase } from "../utils/snakeCase.js"; +import { isEmpty } from "../utils/isEmpty.js"; +import { smartEscape } from "../utils/smartEscape.js"; +import { isNumberLike } from "../utils/isNumberLike.js"; class TextLayer extends Layer { /** * @constructor TextLayer * @param {Object} options - layer parameters */ - constructor(options?:{}) { + constructor(options?: {}) { let keys; super(options); - keys = ["resourceType", "resourceType", "fontFamily", "fontSize", "fontWeight", "fontStyle", "textDecoration", "textAlign", "stroke", "letterSpacing", "lineSpacing", "fontHinting", "fontAntialiasing", "text"]; + keys = [ + "resourceType", + "resourceType", + "fontFamily", + "fontSize", + "fontWeight", + "fontStyle", + "textDecoration", + "textAlign", + "stroke", + "letterSpacing", + "lineSpacing", + "fontHinting", + "fontAntialiasing", + "text", + ]; if (options != null) { keys.forEach((key) => { var ref; // @ts-ignore - return this.options[key] = (ref = options[key]) != null ? ref : options[snakeCase(key)]; + return (this.options[key] = (ref = options[key]) != null ? ref : options[snakeCase(key)]); }); } this.options.resourceType = "text"; } //@ts-ignore - resourceType(resourceType:string) { + resourceType(resourceType: string) { throw "Cannot modify resourceType for text layers"; } //@ts-ignore - type(type:string) { + type(type: string) { throw "Cannot modify type for text layers"; } - format(format:any) { + format(format: any) { throw "Cannot modify format for text layers"; } - fontFamily(fontFamily:string) { + fontFamily(fontFamily: string) { this.options.fontFamily = fontFamily; return this; } - fontSize(fontSize:string | number) { + fontSize(fontSize: string | number) { this.options.fontSize = fontSize; return this; } - fontWeight(fontWeight:string) { + fontWeight(fontWeight: string) { this.options.fontWeight = fontWeight; return this; } - fontStyle(fontStyle:string) { + fontStyle(fontStyle: string) { this.options.fontStyle = fontStyle; return this; } - textDecoration(textDecoration:string) { + textDecoration(textDecoration: string) { this.options.textDecoration = textDecoration; return this; } - textAlign(textAlign:string) { + textAlign(textAlign: string) { this.options.textAlign = textAlign; return this; } - stroke(stroke:string) { + stroke(stroke: string) { this.options.stroke = stroke; return this; } - letterSpacing(letterSpacing:string) { + letterSpacing(letterSpacing: string) { this.options.letterSpacing = letterSpacing; return this; } - lineSpacing(lineSpacing:string) { + lineSpacing(lineSpacing: string) { this.options.lineSpacing = lineSpacing; return this; } - fontHinting (fontHinting:string){ + fontHinting(fontHinting: string) { this.options.fontHinting = fontHinting; return this; } - fontAntialiasing (fontAntialiasing:string){ + fontAntialiasing(fontAntialiasing: string) { this.options.fontAntialiasing = fontAntialiasing; return this; } - text(text:string) { + text(text: string) { this.options.text = text; return this; } @@ -111,7 +126,7 @@ class TextLayer extends Layer { if (this.options.text != null) { hasPublicId = !isEmpty(publicId); hasStyle = !isEmpty(style); - if (hasPublicId && hasStyle || !hasPublicId && !hasStyle) { + if ((hasPublicId && hasStyle) || (!hasPublicId && !hasStyle)) { throw "Must supply either style parameters or a public_id when providing text parameter in a text overlay/underlay, but not both!"; } re = /\$\([a-zA-Z]\w*\)/g; @@ -119,7 +134,7 @@ class TextLayer extends Layer { // textSource = text.replace(new RegExp("[,/]", 'g'), (c)-> "%#{c.charCodeAt(0).toString(16).toUpperCase()}") textSource = smartEscape(this.options.text, /[,\/]/g); text = ""; - while (res = re.exec(textSource)) { + while ((res = re.exec(textSource))) { text += smartEscape(textSource.slice(start, res.index)); text += res[0]; start = res.index + res[0].length; @@ -127,7 +142,7 @@ class TextLayer extends Layer { text += smartEscape(textSource.slice(start)); } components = [this.options.resourceType, style, publicId, text]; - return (components).filter(x => !!x).join(":"); + return components.filter((x) => !!x).join(":"); } textStyleIdentifier() { @@ -152,13 +167,13 @@ class TextLayer extends Layer { if (!(isEmpty(this.options.lineSpacing) && !isNumberLike(this.options.lineSpacing))) { components.push("line_spacing_" + this.options.lineSpacing); } - if (!(isEmpty(this.options.fontAntialiasing))) { - components.push("antialias_"+this.options.fontAntialiasing); + if (!isEmpty(this.options.fontAntialiasing)) { + components.push("antialias_" + this.options.fontAntialiasing); } - if (!(isEmpty(this.options.fontHinting))) { - components.push("hinting_"+this.options.fontHinting ); + if (!isEmpty(this.options.fontHinting)) { + components.push("hinting_" + this.options.fontHinting); } - if (!isEmpty(components.filter(x => !!x))) { + if (!isEmpty(components.filter((x) => !!x))) { if (isEmpty(this.options.fontFamily)) { throw `Must supply fontFamily. ${components}`; } @@ -167,10 +182,9 @@ class TextLayer extends Layer { } } components.unshift(this.options.fontFamily, this.options.fontSize); - components = components.filter(x => !!x).join("_"); + components = components.filter((x) => !!x).join("_"); return components; } - -}; +} export default TextLayer; diff --git a/src/backwards/transformation.ts b/src/backwards/transformation.ts index 95b845c..4bdb75c 100644 --- a/src/backwards/transformation.ts +++ b/src/backwards/transformation.ts @@ -1,49 +1,47 @@ -import Condition from './condition.js'; -import {CONFIG_PARAMS} from './configuration.js'; -import { cloneDeep } from '../internal/utils/cloneDeep.js'; -import {camelCase, contains, difference,} from "./utils/legacyBaseUtil.js"; -import {snakeCase} from "./utils/snakeCase.js"; -import Expression from './expression.js'; -import Layer from './legacyLayer/layer.js'; -import TextLayer from './legacyLayer/textlayer.js'; -import SubtitlesLayer from './legacyLayer/subtitleslayer.js'; -import FetchLayer from './legacyLayer/fetchlayer.js'; -import {isObject} from "./utils/isObject.js"; -import {isString} from "../internal/utils/dataStructureUtils.js"; -import {isEmpty} from "./utils/isEmpty.js"; -import {isFunction} from "./utils/isFunction.js"; -import {identity, withCamelCaseKeys} from "./utils/legacyBaseUtil.js"; +import Condition from "./condition.js"; +import { CONFIG_PARAMS } from "./configuration.js"; +import { cloneDeep } from "../internal/utils/cloneDeep.js"; +import { camelCase, contains, difference } from "./utils/legacyBaseUtil.js"; +import { snakeCase } from "./utils/snakeCase.js"; +import Expression from "./expression.js"; +import Layer from "./legacyLayer/layer.js"; +import TextLayer from "./legacyLayer/textlayer.js"; +import SubtitlesLayer from "./legacyLayer/subtitleslayer.js"; +import FetchLayer from "./legacyLayer/fetchlayer.js"; +import { isObject } from "./utils/isObject.js"; +import { isString } from "../internal/utils/dataStructureUtils.js"; +import { isEmpty } from "./utils/isEmpty.js"; +import { isFunction } from "./utils/isFunction.js"; +import { identity, withCamelCaseKeys } from "./utils/legacyBaseUtil.js"; /** * A list of keys used by the url() function. * @private */ export const URL_KEYS = [ - 'accessibility', - 'api_secret', - 'auth_token', - 'cdn_subdomain', - 'cloud_name', - 'cname', - 'format', - 'placeholder', - 'private_cdn', - 'resource_type', - 'secure', - 'secure_cdn_subdomain', - 'secure_distribution', - 'shorten', - 'sign_url', - 'signature', - 'ssl_detected', - 'type', - 'url_suffix', - 'use_root_path', - 'version' + "accessibility", + "api_secret", + "auth_token", + "cdn_subdomain", + "cloud_name", + "cname", + "format", + "placeholder", + "private_cdn", + "resource_type", + "secure", + "secure_cdn_subdomain", + "secure_distribution", + "shorten", + "sign_url", + "signature", + "ssl_detected", + "type", + "url_suffix", + "use_root_path", + "version", ]; - - /** * Assign key, value to target, when value is not null.
      * This function mutates the target! @@ -51,9 +49,9 @@ export const URL_KEYS = [ * @param {object} sources one or more objects to get values from * @returns {object} the target after the assignment */ -function assignNotNull(target:{}, ...sources:object[]) { - sources.forEach(source => { - Object.keys(source).forEach(key => { +function assignNotNull(target: {}, ...sources: object[]) { + sources.forEach((source) => { + Object.keys(source).forEach((key) => { // @ts-ignore if (source[key] != null) { // @ts-ignore @@ -64,17 +62,12 @@ function assignNotNull(target:{}, ...sources:object[]) { return target; } - - - - - /** * Return true if all items in list are strings * @function Util.allString * @param {Array} list - an array of items */ -const allStrings = function(list:[]) { +const allStrings = function (list: []) { return list.length && list.every(isString); }; @@ -96,7 +89,7 @@ class Param { * @param {function} [process=Util.identity ] - Manipulate origValue when value is called * @ignore */ - constructor(name:string, shortName:string, process = identity) { + constructor(name: string, shortName: string, process = identity) { /** * The name of the parameter in snake_case * @member {string} Param#name @@ -134,10 +127,10 @@ class Param { var val, valid; val = this.value(); valid = Array.isArray(val) || isObject(val) || isString(val) ? !isEmpty(val) : val != null; - if ((this.shortName != null) && valid) { + if (this.shortName != null && valid) { return `${this.shortName}_${val}`; } else { - return ''; + return ""; } } @@ -150,11 +143,11 @@ class Param { } static norm_color(value: string) { - return value != null ? value.replace(/^#/, 'rgb:') : void 0; + return value != null ? value.replace(/^#/, "rgb:") : void 0; } static build_array(arg: any) { - if(arg == null) { + if (arg == null) { return []; } else if (Array.isArray(arg)) { return arg; @@ -175,16 +168,16 @@ class Param { { codec: 'h264', profile: 'basic', level: '3.1' } * @ignore */ - static process_video_params(param:any) { + static process_video_params(param: any) { var video; switch (param.constructor) { case Object: video = ""; - if ('codec' in param) { + if ("codec" in param) { video = param.codec; - if ('profile' in param) { + if ("profile" in param) { video += ":" + param.profile; - if ('level' in param) { + if ("level" in param) { video += ":" + param.level; } } @@ -211,7 +204,7 @@ class ArrayParam extends Param { * @extends Param * @ignore */ - constructor(name:string, shortName:string, sep: string = '.', process: (x: any) => any = undefined) { + constructor(name: string, shortName: string, sep: string = ".", process: (x: any) => any = undefined) { super(name, shortName, process); this.sep = sep; } @@ -220,28 +213,30 @@ class ArrayParam extends Param { if (this.shortName != null) { let arrayValue = this.value(); if (isEmpty(arrayValue)) { - return ''; + return ""; } else if (isString(arrayValue)) { return `${this.shortName}_${arrayValue}`; } else { - let flat = arrayValue.map((t: { serialize: () => any; })=>isFunction(t.serialize) ? t.serialize() : t).join(this.sep); + let flat = arrayValue + .map((t: { serialize: () => any }) => (isFunction(t.serialize) ? t.serialize() : t)) + .join(this.sep); return `${this.shortName}_${flat}`; } } else { - return ''; + return ""; } } value() { if (Array.isArray(this.origValue)) { - return this.origValue.map(v=>this.process(v)); + return this.origValue.map((v) => this.process(v)); } else { return this.process(this.origValue); } } set(origValue: any) { - if ((origValue == null) || Array.isArray(origValue)) { + if (origValue == null || Array.isArray(origValue)) { return super.set(origValue); } else { return super.set([origValue]); @@ -261,7 +256,7 @@ class TransformationParam extends Param { * @extends Param * @ignore */ - constructor(name:string, shortName = "t", sep = '.', process:(x: any) => any = undefined) { + constructor(name: string, shortName = "t", sep = ".", process: (x: any) => any = undefined) { super(name, shortName, process); this.sep = sep; } @@ -271,7 +266,7 @@ class TransformationParam extends Param { * @returns {*} Returns either the transformation as a string, or an array of string representations. */ serialize() { - let result = ''; + let result = ""; const val = this.value(); if (isEmpty(val)) { @@ -280,24 +275,27 @@ class TransformationParam extends Param { // val is an array of strings so join them if (allStrings(val)) { - const joined = val.join(this.sep); // creates t1.t2.t3 in case multiple named transformations were configured + const joined = val.join(this.sep); // creates t1.t2.t3 in case multiple named transformations were configured if (!isEmpty(joined)) { // in case options.transformation was not set with an empty string (val != ['']); result = `${this.shortName}_${joined}`; } - } else { // Convert val to an array of strings - result = val.map((t: { serialize: () => any; }) => { - if (isString(t) && !isEmpty(t)) { - return `${this.shortName}_${t}`; - } - if (isFunction(t.serialize)) { - return t.serialize(); - } - if (isObject(t) && !isEmpty(t)) { - return new Transformation(t).serialize(); - } - return undefined; - }).filter((t: any)=>t); + } else { + // Convert val to an array of strings + result = val + .map((t: { serialize: () => any }) => { + if (isString(t) && !isEmpty(t)) { + return `${this.shortName}_${t}`; + } + if (isFunction(t.serialize)) { + return t.serialize(); + } + if (isObject(t) && !isEmpty(t)) { + return new Transformation(t).serialize(); + } + return undefined; + }) + .filter((t: any) => t); } return result; } @@ -316,7 +314,6 @@ const number_pattern = "([0-9]*)\\.([0-9]+)|([0-9]+)"; const offset_any_pattern = "(" + number_pattern + ")([%pP])?"; class RangeParam extends Param { - /** * A parameter that represents a range * @param {string} name - The name of the parameter in snake_case @@ -327,14 +324,13 @@ class RangeParam extends Param { * @extends Param * @ignore */ - constructor(name:string, shortName:string, process = RangeParam.norm_range_value) { + constructor(name: string, shortName: string, process = RangeParam.norm_range_value) { super(name, shortName, process); } static norm_range_value(value: string) { - - let offset = String(value).match(new RegExp('^' + offset_any_pattern + '$')); + let offset = String(value).match(new RegExp("^" + offset_any_pattern + "$")); if (offset) { - let modifier = offset[5] != null ? 'p' : ''; + let modifier = offset[5] != null ? "p" : ""; value = (offset[1] || offset[4]) + modifier; } return value; @@ -349,7 +345,6 @@ class RawParam extends Param { serialize() { return this.value(); } - } class LayerParam extends Param { @@ -358,7 +353,7 @@ class LayerParam extends Param { // @private value() { if (this.origValue == null) { - return ''; + return ""; } let result; if (this.origValue instanceof Layer) { @@ -366,13 +361,15 @@ class LayerParam extends Param { } else if (isObject(this.origValue)) { let layerOptions = withCamelCaseKeys(this.origValue); // @ts-ignore - if (layerOptions.resourceType === "text" || (layerOptions.text != null)) { + if (layerOptions.resourceType === "text" || layerOptions.text != null) { result = new TextLayer(layerOptions); - } else { // @ts-ignore + } else { + // @ts-ignore if (layerOptions.resourceType === "subtitles") { result = new SubtitlesLayer(layerOptions); - } else { // @ts-ignore - if (layerOptions.resourceType === "fetch" || (layerOptions.url != null)) { + } else { + // @ts-ignore + if (layerOptions.resourceType === "fetch" || layerOptions.url != null) { result = new FetchLayer(layerOptions); } else { result = new Layer(layerOptions); @@ -386,17 +383,16 @@ class LayerParam extends Param { result = this.origValue; } } else { - result = ''; + result = ""; } return result.toString(); } - static textStyle(layer: { key?: any; }) { - return (new TextLayer(layer)).textStyleIdentifier(); + static textStyle(layer: { key?: any }) { + return new TextLayer(layer).textStyleIdentifier(); } } - /** * TransformationBase * Depends on 'configuration', 'parameters','util' @@ -412,12 +408,26 @@ class TransformationBase { protected param?: (value?: any, name?: any, abbr?: any, defaultValue?: any, process?: any) => this; protected rawParam?: (value?: any, name?: any, abbr?: any, defaultValue?: any, process?: any) => TransformationBase; protected rangeParam?: (value?: any, name?: any, abbr?: any, defaultValue?: any, process?: any) => TransformationBase; - protected arrayParam: (value?: any, name?: any, abbr?: any, sep?: string, defaultValue?: any, process?: any) => TransformationBase; - protected transformationParam: (value?: any, name?: any, abbr?: any, sep?: string, defaultValue?: any, process?: any) => TransformationBase; + protected arrayParam: ( + value?: any, + name?: any, + abbr?: any, + sep?: string, + defaultValue?: any, + process?: any + ) => TransformationBase; + protected transformationParam: ( + value?: any, + name?: any, + abbr?: any, + sep?: string, + defaultValue?: any, + process?: any + ) => TransformationBase; protected layerParam: (value?: any, name?: any, abbr?: any) => TransformationBase; protected getValue: (name: any) => any; protected get: (name: any) => any; - private remove: (name: any) => (any | null); + private remove: (name: any) => any | null; private keys: () => any[]; private toPlainObject: () => {} | { transformation: any }; private resetTransformations: () => TransformationBase; @@ -428,11 +438,11 @@ class TransformationBase { * Members of this class are documented as belonging to the {@link Transformation} class for convenience. * @class TransformationBase */ - constructor(options:any) { + constructor(options: any) { /** @private */ /** @private */ - let parent:any; - let trans: {name?:Param|RawParam|RangeParam}; + let parent: any; + let trans: { name?: Param | RawParam | RangeParam }; parent = void 0; trans = {}; /** @@ -440,16 +450,16 @@ class TransformationBase { * @function Transformation#toOptions * @return {Object} Returns a plain object representing this transformation */ - this.toOptions = (withChain:any) => { + this.toOptions = (withChain: any) => { let opt = {}; - if(withChain == null) { + if (withChain == null) { withChain = true; } // @ts-ignore - Object.keys(trans).forEach(key => opt[key] = trans[key].origValue); + Object.keys(trans).forEach((key) => (opt[key] = trans[key].origValue)); assignNotNull(opt, this.otherOptions); if (withChain && !isEmpty(this.chained)) { - let list = this.chained.map((tr: { toOptions: () => any; }) => tr.toOptions()); + let list = this.chained.map((tr: { toOptions: () => any }) => tr.toOptions()); list.push(opt); opt = {}; assignNotNull(opt, this.otherOptions); @@ -479,7 +489,7 @@ class TransformationBase { * @protected * @return {Object} Returns the parent of this object if there is any */ - this.getParent = () => { + this.getParent = () => { return parent; }; @@ -590,7 +600,7 @@ class TransformationBase { */ this.keys = function () { var key; - return ((function () { + return (function () { var results; results = []; for (key in trans) { @@ -599,7 +609,7 @@ class TransformationBase { } } return results; - })()).sort(); + })().sort(); }; /** * Returns a plain object representation of the transformation. Values are processed. @@ -619,10 +629,10 @@ class TransformationBase { } } if (!isEmpty(this.chained)) { - list = this.chained.map((tr: { toPlainObject: () => any; }) => tr.toPlainObject()); + list = this.chained.map((tr: { toPlainObject: () => any }) => tr.toPlainObject()); list.push(hash); hash = { - transformation: list + transformation: list, }; } return hash; @@ -667,7 +677,7 @@ class TransformationBase { } else { if (isString(options) || Array.isArray(options)) { options = { - transformation: options + transformation: options, }; } options = cloneDeep(options); @@ -682,10 +692,10 @@ class TransformationBase { for (let key in options) { // @ts-ignore let opt = options[key]; - if(opt != null) { + if (opt != null) { if (key.match(VAR_NAME_RE)) { - if (key !== '$attr') { - this.set('variable', key, opt); + if (key !== "$attr") { + this.set("variable", key, opt); } } else { this.set(key, opt); @@ -696,11 +706,9 @@ class TransformationBase { return this; } - fromTransformation(other:any) { + fromTransformation(other: any) { if (other instanceof TransformationBase) { - other.keys().forEach(key => - this.set(key, other.get(key).origValue) - ); + other.keys().forEach((key) => this.set(key, other.get(key).origValue)); } return this; } @@ -712,7 +720,7 @@ class TransformationBase { * @param {*} values - the value of the parameter * @returns {Transformation} Returns this instance for chaining */ - set(key:string, ...values: string[]) { + set(key: string, ...values: string[]) { let camelKey; camelKey = camelCase(key); if (contains(methods, camelKey)) { @@ -734,9 +742,24 @@ class TransformationBase { * @return {string} Returns the transformation as a string */ serialize() { - var ifParam, j, len, paramList, ref, ref1, ref2, ref3, ref4, resultArray, t, transformationList, - transformationString, transformations, value, variables, vars; - resultArray = this.chained.map((tr: { serialize?: () => any; }) => tr.serialize()); + var ifParam, + j, + len, + paramList, + ref, + ref1, + ref2, + ref3, + ref4, + resultArray, + t, + transformationList, + transformationString, + transformations, + value, + variables, + vars; + resultArray = this.chained.map((tr: { serialize?: () => any }) => tr.serialize()); paramList = this.keys(); transformations = (ref = this.get("transformation")) != null ? ref.serialize() : void 0; ifParam = (ref1 = this.get("if")) != null ? ref1.serialize() : void 0; @@ -764,7 +787,7 @@ class TransformationBase { results = []; for (k = 0, len1 = transformationList.length; k < len1; k++) { value = transformationList[k]; - if (Array.isArray(value) && !isEmpty(value) || !Array.isArray(value) && value) { + if ((Array.isArray(value) && !isEmpty(value)) || (!Array.isArray(value) && value)) { results.push(value); } } @@ -776,11 +799,11 @@ class TransformationBase { } else if (!isEmpty(ifParam)) { transformationList.unshift(ifParam); } - transformationString = (transformationList).filter(x => !!x).join(param_separator); + transformationString = transformationList.filter((x) => !!x).join(param_separator); if (!isEmpty(transformationString)) { resultArray.push(transformationString); } - return (resultArray).filter((x: any) => !!x).join(trans_separator); + return resultArray.filter((x: any) => !!x).join(trans_separator); } /** @@ -799,10 +822,10 @@ class TransformationBase { * @return PlainObject */ toHtmlAttributes() { - let attrName, height, options:any, ref2, ref3, value, width; + let attrName, height, options: any, ref2, ref3, value, width; options = {}; let snakeCaseKey; - Object.keys(this.otherOptions).forEach(key=>{ + Object.keys(this.otherOptions).forEach((key) => { value = this.otherOptions[key]; snakeCaseKey = snakeCase(key); if (!contains(PARAM_NAMES, snakeCaseKey) && !contains(URL_KEYS, snakeCaseKey)) { @@ -811,7 +834,7 @@ class TransformationBase { } }); // convert all "html_key" to "key" with the same value - this.keys().forEach(key => { + this.keys().forEach((key) => { if (/^html_/.test(key)) { options[camelCase(key.slice(5))] = this.getValue(key); } @@ -849,9 +872,9 @@ class TransformationBase { * tag.transformation().crop("fit").width(300).toHtml() * // */ - toHtml():any { + toHtml(): any { var ref; - return (ref = this.getParent()) != null ? typeof ref.toHtml === "function" ? ref.toHtml() : void 0 : void 0; + return (ref = this.getParent()) != null ? (typeof ref.toHtml === "function" ? ref.toHtml() : void 0) : void 0; } toString() { @@ -865,10 +888,9 @@ class TransformationBase { const VAR_NAME_RE = /^\$[a-zA-Z0-9]+$/; -const trans_separator = '/'; - -const param_separator = ','; +const trans_separator = "/"; +const param_separator = ","; function lastArgCallback(args: string | IArguments | any[]) { var callback; @@ -895,10 +917,10 @@ function processVar(varArray: string | any[]) { } // @ts-ignore -function processCustomFunction({function_type, source}) { - if (function_type === 'remote') { +function processCustomFunction({ function_type, source }) { + if (function_type === "remote") { return [function_type, btoa(source)].join(":"); - } else if (function_type === 'wasm') { + } else if (function_type === "wasm") { return [function_type, source].join(":"); } } @@ -947,7 +969,7 @@ class Transformation extends TransformationBase { * @return {Transformation} * @example cl = cloudinary.Transformation.new( {angle: 20, crop: "scale", width: "auto"}) */ - static new(options?: { serialize?: () => any; }) { + static new(options?: { serialize?: () => any }) { return new Transformation(options); } @@ -985,12 +1007,16 @@ class Transformation extends TransformationBase { } border(value: string | number) { - return this.param(value, "border", "bo", (border:any) => { + return this.param(value, "border", "bo", (border: any) => { if (isObject(border)) { - border = Object.assign({}, { - color: "black", - width: 2 - }, border); + border = Object.assign( + {}, + { + color: "black", + width: 2, + }, + border + ); return `${border.width}px_solid_${Param.norm_color(border.color)}`; } else { return border; @@ -1020,7 +1046,7 @@ class Transformation extends TransformationBase { } customPreFunction(value: any) { - if (this.get('custom_function')) { + if (this.get("custom_function")) { return; } return this.rawParam(value, "custom_function", "", () => { @@ -1049,7 +1075,7 @@ class Transformation extends TransformationBase { return this; } - dpr(value: string | number) { + dpr(value: string | number) { return this.param(value, "dpr", "dpr", (dpr: string) => { dpr = dpr.toString(); if (dpr != null ? dpr.match(/^\d+$/) : void 0) { @@ -1066,11 +1092,11 @@ class Transformation extends TransformationBase { } else() { - return this.if('else'); + return this.if("else"); } endIf() { - return this.if('end'); + return this.if("end"); } endOffset(value: string | number) { @@ -1103,7 +1129,7 @@ class Transformation extends TransformationBase { return this; } - fps(value: string | Array) { + fps(value: string | Array) { return this.param(value, "fps", "fps", (fps: any[]) => { if (isString(fps)) { return fps; @@ -1115,7 +1141,7 @@ class Transformation extends TransformationBase { }); } - height(value:string | number) { + height(value: string | number) { return this.param(value, "height", "h", () => { if (this.getValue("crop") || this.getValue("overlay") || this.getValue("underlay")) { return Expression.normalize(value); @@ -1125,12 +1151,12 @@ class Transformation extends TransformationBase { }); } - htmlHeight(value:string) { + htmlHeight(value: string) { this.param(value, "html_height"); return this; } - htmlWidth(value:string) { + htmlWidth(value: string) { this.param(value, "html_width"); return this; } @@ -1161,25 +1187,29 @@ class Transformation extends TransformationBase { case "": return Condition.new().setParent(this); default: - return this.param(value, "if", "if", (value:any) => { + return this.param(value, "if", "if", (value: any) => { return Condition.new(value).toString(); }); } } - keyframeInterval(value:number) { + keyframeInterval(value: number) { this.param(value, "keyframe_interval", "ki"); return this; } - ocr(value:any) { + ocr(value: any) { this.param(value, "ocr", "ocr"); return this; } - offset(value:any) { + offset(value: any) { var end_o, start_o; - [start_o, end_o] = (isFunction(value != null ? value.split : void 0)) ? value.split('..') : Array.isArray(value) ? value : [null, null]; + [start_o, end_o] = isFunction(value != null ? value.split : void 0) + ? value.split("..") + : Array.isArray(value) + ? value + : [null, null]; if (start_o != null) { this.startOffset(start_o); } @@ -1231,7 +1261,7 @@ class Transformation extends TransformationBase { size(value: string) { let height, width; if (isFunction(value != null ? value.split : void 0)) { - [width, height] = value.split('x'); + [width, height] = value.split("x"); this.width(width); return this.height(height); } @@ -1246,17 +1276,17 @@ class Transformation extends TransformationBase { return this.param(value, "source_transformation"); } - startOffset(value:string | number) { + startOffset(value: string | number) { this.rangeParam(value, "start_offset", "so"); return this; } - streamingProfile(value:string) { + streamingProfile(value: string) { this.param(value, "streaming_profile", "sp"); return this; } - transformation(value:any) { + transformation(value: any) { this.transformationParam(value, "transformation", "t"); return this; } @@ -1276,18 +1306,18 @@ class Transformation extends TransformationBase { return this; } - videoCodec(value:string | number | Object) { - this.param(value, "video_codec", "vc", Param.process_video_params); - return this; + videoCodec(value: string | number | Object) { + this.param(value, "video_codec", "vc", Param.process_video_params); + return this; } - videoSampling(value:string | number) { + videoSampling(value: string | number) { this.param(value, "video_sampling", "vs"); return this; } - width(value:string | number) { - this.param(value, "width", "w", () => { + width(value: string | number) { + this.param(value, "width", "w", () => { if (this.getValue("crop") || this.getValue("overlay") || this.getValue("underlay")) { return Expression.normalize(value); } else { @@ -1297,21 +1327,20 @@ class Transformation extends TransformationBase { return this; } - x(value:number) { + x(value: number) { this.param(value, "x", "x", Expression.normalize); return this; } - y(value:number) { + y(value: number) { this.param(value, "y", "y", Expression.normalize); return this; } - zoom(value:number | string) { + zoom(value: number | string) { this.param(value, "zoom", "z", Expression.normalize); return this; } - } /** @@ -1376,7 +1405,7 @@ const methods = [ "width", "x", "y", - "zoom" + "zoom", ]; /** diff --git a/src/backwards/transformationProcessing/processCustomFunction.ts b/src/backwards/transformationProcessing/processCustomFunction.ts index 737ff05..779b43c 100644 --- a/src/backwards/transformationProcessing/processCustomFunction.ts +++ b/src/backwards/transformationProcessing/processCustomFunction.ts @@ -1,5 +1,5 @@ -import {base64Encode} from "../../internal/utils/base64Encode.js"; -import {isObject} from "../utils/isObject.js"; +import { base64Encode } from "../../internal/utils/base64Encode.js"; +import { isObject } from "../utils/isObject.js"; /** * Parse custom_function options @@ -13,9 +13,9 @@ export function processCustomFunction(customFunction: any) { } if (customFunction.function_type === "remote") { const encodedSource = base64Encode(customFunction.source) - .replace(/\+/g, '-') // Convert '+' to '-' - .replace(/\//g, '_') // Convert '/' to '_' - .replace(/=+$/, ''); // Remove ending '=' + .replace(/\+/g, "-") // Convert '+' to '-' + .replace(/\//g, "_") // Convert '/' to '_' + .replace(/=+$/, ""); // Remove ending '=' return [customFunction.function_type, encodedSource].join(":"); } return [customFunction.function_type, customFunction.source].join(":"); diff --git a/src/backwards/transformationProcessing/processCustomPreFunction.ts b/src/backwards/transformationProcessing/processCustomPreFunction.ts index e536f6d..9205a2a 100644 --- a/src/backwards/transformationProcessing/processCustomPreFunction.ts +++ b/src/backwards/transformationProcessing/processCustomPreFunction.ts @@ -1,4 +1,4 @@ -import {processCustomFunction} from "./processCustomFunction.js"; +import { processCustomFunction } from "./processCustomFunction.js"; /** * Parse custom_pre_function options @@ -8,5 +8,5 @@ import {processCustomFunction} from "./processCustomFunction.js"; */ export function processCustomPreFunction(customPreFunction: any) { const result = processCustomFunction(customPreFunction); - return typeof result === 'string' ? `pre:${result}` : null; + return typeof result === "string" ? `pre:${result}` : null; } diff --git a/src/backwards/transformationProcessing/processIf.ts b/src/backwards/transformationProcessing/processIf.ts index 825e205..3f862e7 100644 --- a/src/backwards/transformationProcessing/processIf.ts +++ b/src/backwards/transformationProcessing/processIf.ts @@ -1,4 +1,4 @@ -import {legacyNormalizeExpression} from "../utils/legacyNormalizeExpression.js"; +import { legacyNormalizeExpression } from "../utils/legacyNormalizeExpression.js"; /** * Parse "if" parameter diff --git a/src/backwards/transformationProcessing/processLayer.ts b/src/backwards/transformationProcessing/processLayer.ts index 87b1589..f78651d 100644 --- a/src/backwards/transformationProcessing/processLayer.ts +++ b/src/backwards/transformationProcessing/processLayer.ts @@ -4,15 +4,15 @@ * @param {object|*} layer The layer to parse. * @return {string} layer transformation string */ -import {isObject} from "../utils/isObject.js"; -import {base64Encode} from "../../internal/utils/base64Encode.js"; -import {LAYER_KEYWORD_PARAMS} from "../consts.js"; -import {smartEscape} from "../utils/smartEscape.js"; +import { isObject } from "../utils/isObject.js"; +import { base64Encode } from "../../internal/utils/base64Encode.js"; +import { LAYER_KEYWORD_PARAMS } from "../consts.js"; +import { smartEscape } from "../utils/smartEscape.js"; import TextLayer from "../legacyLayer/textlayer.js"; import Layer from "../legacyLayer/layer.js"; export function textStyle(layer: any) { - const keywords:any[] = []; + const keywords: any[] = []; let style = ""; Object.keys(LAYER_KEYWORD_PARAMS).forEach((attr: keyof typeof LAYER_KEYWORD_PARAMS) => { let default_value = LAYER_KEYWORD_PARAMS[attr]; @@ -44,14 +44,13 @@ export function textStyle(layer: any) { return style; } - export function processLayer(layer: any) { - if (layer instanceof TextLayer || layer instanceof Layer){ + if (layer instanceof TextLayer || layer instanceof Layer) { return layer.toString(); } - let result = ''; + let result = ""; if (isObject(layer)) { - if (layer.resource_type === "fetch" || (layer.url != null)) { + if (layer.resource_type === "fetch" || layer.url != null) { result = `fetch:${base64Encode(layer.url)}`; } else { let public_id = layer.public_id; @@ -63,12 +62,12 @@ export function processLayer(layer: any) { let components = []; const noPublicId = !public_id || public_id.length === 0; if (!noPublicId) { - public_id = public_id.replace(new RegExp("/", 'g'), ":"); + public_id = public_id.replace(new RegExp("/", "g"), ":"); if (format != null) { public_id = `${public_id}.${format}`; } } - if ((!text || text.length ===0) && resource_type !== "text") { + if ((!text || text.length === 0) && resource_type !== "text") { if (noPublicId) { throw "Must supply public_id for resource_type layer_parameter"; } @@ -80,8 +79,8 @@ export function processLayer(layer: any) { type = null; // type is ignored for text layers style = textStyle(layer); - if (text && text.length >=0 ) { - const noStyle = !style + if (text && text.length >= 0) { + const noStyle = !style; if (!(noPublicId || noStyle) || (noPublicId && noStyle)) { throw "Must supply either style parameters or a public_id when providing text parameter in a text overlay/underlay"; } diff --git a/src/backwards/transformationProcessing/processRadius.ts b/src/backwards/transformationProcessing/processRadius.ts index 23336b3..3ec9e10 100644 --- a/src/backwards/transformationProcessing/processRadius.ts +++ b/src/backwards/transformationProcessing/processRadius.ts @@ -1,5 +1,4 @@ -import {legacyNormalizeExpression} from "../utils/legacyNormalizeExpression.js"; - +import { legacyNormalizeExpression } from "../utils/legacyNormalizeExpression.js"; /** * Parse radius options @@ -18,12 +17,11 @@ export function processRadius(_radius: any) { radius = [radius]; } - if (radius.length === 0 || radius.length > 4) { throw new Error("Radius array should contain between 1 and 4 values"); } if (radius.findIndex((x: any) => x === null) >= 0) { throw new Error("Corner: Cannot be null"); } - return radius.map(legacyNormalizeExpression).join(':'); + return radius.map(legacyNormalizeExpression).join(":"); } diff --git a/src/backwards/transformationProcessing/processVideoParams.ts b/src/backwards/transformationProcessing/processVideoParams.ts index 309ac18..2984934 100644 --- a/src/backwards/transformationProcessing/processVideoParams.ts +++ b/src/backwards/transformationProcessing/processVideoParams.ts @@ -10,11 +10,11 @@ export function processVideoParams(param: any) { switch (param && param.constructor) { case Object: { let video = ""; - if ('codec' in param) { + if ("codec" in param) { video = param.codec; - if ('profile' in param) { + if ("profile" in param) { video += ":" + param.profile; - if ('level' in param) { + if ("level" in param) { video += ":" + param.level; } } diff --git a/src/backwards/utils/finalizeResourceType.ts b/src/backwards/utils/finalizeResourceType.ts index c2734ff..2475eb2 100644 --- a/src/backwards/utils/finalizeResourceType.ts +++ b/src/backwards/utils/finalizeResourceType.ts @@ -1,37 +1,45 @@ -export function finalize_resource_type(resource_type: string, type: string, url_suffix: string, use_root_path: boolean, shorten: boolean) { +export function finalize_resource_type( + resource_type: string, + type: string, + url_suffix: string, + use_root_path: boolean, + shorten: boolean +) { if (type == null) { - type = 'upload'; + type = "upload"; } if (url_suffix != null) { - if (resource_type === 'image' && type === 'upload') { + if (resource_type === "image" && type === "upload") { resource_type = "images"; type = null; - } else if (resource_type === 'image' && type === 'private') { - resource_type = 'private_images'; + } else if (resource_type === "image" && type === "private") { + resource_type = "private_images"; type = null; - } else if (resource_type === 'image' && type === 'authenticated') { - resource_type = 'authenticated_images'; + } else if (resource_type === "image" && type === "authenticated") { + resource_type = "authenticated_images"; type = null; - } else if (resource_type === 'raw' && type === 'upload') { - resource_type = 'files'; + } else if (resource_type === "raw" && type === "upload") { + resource_type = "files"; type = null; - } else if (resource_type === 'video' && type === 'upload') { - resource_type = 'videos'; + } else if (resource_type === "video" && type === "upload") { + resource_type = "videos"; type = null; } else { - throw new Error("URL Suffix only supported for image/upload, image/private, image/authenticated, video/upload and raw/upload"); + throw new Error( + "URL Suffix only supported for image/upload, image/private, image/authenticated, video/upload and raw/upload" + ); } } if (use_root_path) { - if ((resource_type === 'image' && type === 'upload') || (resource_type === 'images' && (type == null))) { + if ((resource_type === "image" && type === "upload") || (resource_type === "images" && type == null)) { resource_type = null; type = null; } else { throw new Error("Root path only supported for image/upload"); } } - if (shorten && resource_type === 'image' && type === 'upload') { - resource_type = 'iu'; + if (shorten && resource_type === "image" && type === "upload") { + resource_type = "iu"; type = null; } return [resource_type, type]; diff --git a/src/backwards/utils/finalize_source.ts b/src/backwards/utils/finalize_source.ts index 0021a11..c6d2f94 100644 --- a/src/backwards/utils/finalize_source.ts +++ b/src/backwards/utils/finalize_source.ts @@ -1,8 +1,8 @@ -import {smartEscape} from "./smartEscape.js"; +import { smartEscape } from "./smartEscape.js"; export function finalize_source(source: string, format: string, url_suffix: string) { let source_to_sign; - source = source.replace(/([^:])\/\//g, '$1/'); + source = source.replace(/([^:])\/\//g, "$1/"); if (source.match(/^https?:\//i)) { source = smartEscape(source); source_to_sign = source; @@ -11,13 +11,13 @@ export function finalize_source(source: string, format: string, url_suffix: stri source_to_sign = source; if (url_suffix) { if (url_suffix.match(/[\.\/]/)) { - throw new Error('url_suffix should not include . or /'); + throw new Error("url_suffix should not include . or /"); } - source = source + '/' + url_suffix; + source = source + "/" + url_suffix; } if (format != null) { - source = source + '.' + format; - source_to_sign = source_to_sign + '.' + format; + source = source + "." + format; + source_to_sign = source_to_sign + "." + format; } } return [source, source_to_sign]; diff --git a/src/backwards/utils/isEmpty.ts b/src/backwards/utils/isEmpty.ts index 63d577b..6c2b33c 100644 --- a/src/backwards/utils/isEmpty.ts +++ b/src/backwards/utils/isEmpty.ts @@ -1,6 +1,8 @@ -export function isEmpty(value:any){ - return value === undefined || +export function isEmpty(value: any) { + return ( + value === undefined || value === null || (typeof value === "object" && Object.keys(value).length === 0) || (typeof value === "string" && value.trim().length === 0) + ); } diff --git a/src/backwards/utils/isNumberLike.ts b/src/backwards/utils/isNumberLike.ts index 66c125d..adccf79 100644 --- a/src/backwards/utils/isNumberLike.ts +++ b/src/backwards/utils/isNumberLike.ts @@ -9,6 +9,6 @@ * Util.isNumber("") // false * Util.isNumber(undefined) // false */ -export const isNumberLike = function(value: any) { - return (value != null) && !isNaN(parseFloat(value)); +export const isNumberLike = function (value: any) { + return value != null && !isNaN(parseFloat(value)); }; diff --git a/src/backwards/utils/isObject.ts b/src/backwards/utils/isObject.ts index fa195a6..fd57ded 100644 --- a/src/backwards/utils/isObject.ts +++ b/src/backwards/utils/isObject.ts @@ -1,8 +1,7 @@ - /** * * @param a */ export function isObject(a: any): a is Record { - return typeof a === 'object' && a !== null; + return typeof a === "object" && a !== null; } diff --git a/src/backwards/utils/legacyBaseUtil.ts b/src/backwards/utils/legacyBaseUtil.ts index cd1e729..66e5765 100644 --- a/src/backwards/utils/legacyBaseUtil.ts +++ b/src/backwards/utils/legacyBaseUtil.ts @@ -4,40 +4,41 @@ * @return {Object} a new object * @param source */ -import {isEmpty} from "./isEmpty.js"; +import { isEmpty } from "./isEmpty.js"; -export const withCamelCaseKeys = function(source: {}) { +export const withCamelCaseKeys = function (source: {}) { return convertKeys(source, camelCase); }; - /** * Convert string to camelCase * @function Util.camelCase * @param {string} source - the string to convert * @return {string} in camelCase format */ -export const camelCase = function(source: string) { +export const camelCase = function (source: string) { var words = source.match(reWords); - words = words.map(word=> word.charAt(0).toLocaleUpperCase() + word.slice(1).toLocaleLowerCase()); + words = words.map((word) => word.charAt(0).toLocaleUpperCase() + word.slice(1).toLocaleLowerCase()); words[0] = words[0].toLocaleLowerCase(); - return words.join(''); + return words.join(""); }; - /** * Creates a new object from source, with the keys transformed using the converter. * @param {object} source * @param {function|null} converter * @returns {object} */ -export var convertKeys = function(source: { [x: string]: any; }, converter: { (source: string): string; (arg0: string): string; }) { +export var convertKeys = function ( + source: { [x: string]: any }, + converter: { (source: string): string; (arg0: string): string } +) { var result, value; result = {}; for (let key in source) { value = source[key]; - if(converter) { + if (converter) { key = converter(key); } if (!isEmpty(key)) { @@ -48,14 +49,14 @@ export var convertKeys = function(source: { [x: string]: any; }, converter: { (s return result; }; -export var reWords = (function() { +export var reWords = (function () { var lower, upper; - upper = '[A-Z]'; - lower = '[a-z]+'; - return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); + upper = "[A-Z]"; + lower = "[a-z]+"; + return RegExp(upper + "+(?=" + upper + lower + ")|" + upper + "?" + lower + "|" + upper + "+|[0-9]+", "g"); })(); -export function identity(x:any) { +export function identity(x: any) { return x; } @@ -68,7 +69,6 @@ export function contains(a: string | any[], obj: any) { return false; } -export function difference(arr1:any[], arr2:any[]){ - return arr1.filter(x => !arr2.includes(x)); +export function difference(arr1: any[], arr2: any[]) { + return arr1.filter((x) => !arr2.includes(x)); } - diff --git a/src/backwards/utils/legacyNormalizeExpression.ts b/src/backwards/utils/legacyNormalizeExpression.ts index 2e3e695..ce8066a 100644 --- a/src/backwards/utils/legacyNormalizeExpression.ts +++ b/src/backwards/utils/legacyNormalizeExpression.ts @@ -1,4 +1,4 @@ -import {LEGACY_PREDEFINED_VARS, LEGACY_CONDITIONAL_OPERATORS} from "../consts.js"; +import { LEGACY_PREDEFINED_VARS, LEGACY_CONDITIONAL_OPERATORS } from "../consts.js"; /** * Normalize an offset value @@ -6,7 +6,7 @@ import {LEGACY_PREDEFINED_VARS, LEGACY_CONDITIONAL_OPERATORS} from "../consts.js * @return {Object|String} a normalized String of the input value if possible otherwise the value itself */ export function legacyNormalizeExpression(expression: string | any) { - if (typeof expression !== 'string' || expression.length === 0 || expression.match(/^!.+!$/)) { + if (typeof expression !== "string" || expression.length === 0 || expression.match(/^!.+!$/)) { if (expression) { return expression.toString(); } else { @@ -21,15 +21,15 @@ export function legacyNormalizeExpression(expression: string | any) { const operatorsPattern = "((" + operators + ")(?=[ _]))"; const operatorsReplaceRE = new RegExp(operatorsPattern, "g"); expression = expression.replace(operatorsReplaceRE, (match: keyof typeof LEGACY_CONDITIONAL_OPERATORS) => { - return LEGACY_CONDITIONAL_OPERATORS[match] + return LEGACY_CONDITIONAL_OPERATORS[match]; }); // predefined variables const predefinedVarsPattern = "(" + Object.keys(LEGACY_PREDEFINED_VARS).join("|") + ")"; - const userVariablePattern = '(\\$_*[^_ ]+)'; + const userVariablePattern = "(\\$_*[^_ ]+)"; const variablesReplaceRE = new RegExp(`${userVariablePattern}|${predefinedVarsPattern}`, "g"); // @ts-ignore - expression = expression.replace(variablesReplaceRE, (match: string) => (LEGACY_PREDEFINED_VARS[match] || match)); + expression = expression.replace(variablesReplaceRE, (match: string) => LEGACY_PREDEFINED_VARS[match] || match); - return expression.replace(/[ _]+/g, '_'); + return expression.replace(/[ _]+/g, "_"); } diff --git a/src/backwards/utils/norm_range_values.ts b/src/backwards/utils/norm_range_values.ts index 716b0a3..92f36be 100644 --- a/src/backwards/utils/norm_range_values.ts +++ b/src/backwards/utils/norm_range_values.ts @@ -1,5 +1,5 @@ -import {RANGE_VALUE_RE} from "../consts.js"; -import {stringOrNumber} from "../../types/types.js"; +import { RANGE_VALUE_RE } from "../consts.js"; +import { stringOrNumber } from "../../types/types.js"; /** * @@ -8,7 +8,7 @@ import {stringOrNumber} from "../../types/types.js"; export function normRangeValues(value: stringOrNumber) { const offset = String(value).match(RANGE_VALUE_RE); if (offset) { - const modifier = offset[5] ? 'p' : ''; + const modifier = offset[5] ? "p" : ""; return `${offset[1] || offset[4]}${modifier}`; } else { return value; diff --git a/src/backwards/utils/smartEscape.ts b/src/backwards/utils/smartEscape.ts index 6d7dfd0..1636a61 100644 --- a/src/backwards/utils/smartEscape.ts +++ b/src/backwards/utils/smartEscape.ts @@ -3,9 +3,11 @@ // encodeURIComponent(string).replace(/%3A/g, ":").replace(/%2F/g, "/") export function smartEscape(string: string, unsafe = /([^a-zA-Z0-9_.\-\/:]+)/g) { return string.replace(unsafe, function (match) { - return match.split("").map(function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }).join(""); + return match + .split("") + .map(function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }) + .join(""); }); } - diff --git a/src/backwards/utils/snakeCase.ts b/src/backwards/utils/snakeCase.ts index 7eb06ea..9b00857 100644 --- a/src/backwards/utils/snakeCase.ts +++ b/src/backwards/utils/snakeCase.ts @@ -2,4 +2,4 @@ * Converts string to snake case * @param {string} str */ -export const snakeCase = (str:string) => str.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`); +export const snakeCase = (str: string) => str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); diff --git a/src/backwards/utils/splitRange.ts b/src/backwards/utils/splitRange.ts index 4706c68..9e6abdb 100644 --- a/src/backwards/utils/splitRange.ts +++ b/src/backwards/utils/splitRange.ts @@ -2,7 +2,7 @@ * Split a range into the start and end values * @param range */ -import {OFFSET_ANY_PATTERN_RE} from "../consts.js"; +import { OFFSET_ANY_PATTERN_RE } from "../consts.js"; export function splitRange(range: any) { switch (range && range.constructor) { diff --git a/src/backwards/utils/toArray.ts b/src/backwards/utils/toArray.ts index 33450e4..ad1a1a2 100644 --- a/src/backwards/utils/toArray.ts +++ b/src/backwards/utils/toArray.ts @@ -1,4 +1,3 @@ - /** * * @param arg diff --git a/src/backwards/utils/unsigned_url_prefix.ts b/src/backwards/utils/unsigned_url_prefix.ts index 75f65be..2aff13d 100644 --- a/src/backwards/utils/unsigned_url_prefix.ts +++ b/src/backwards/utils/unsigned_url_prefix.ts @@ -1,4 +1,4 @@ -import {OLD_AKAMAI_SHARED_CDN, SHARED_CDN} from "../consts.js"; +import { OLD_AKAMAI_SHARED_CDN, SHARED_CDN } from "../consts.js"; export function unsigned_url_prefix( source: string, @@ -12,30 +12,30 @@ export function unsigned_url_prefix( ) { let prefix; if (cloud_name.indexOf("/") === 0) { - return '/res' + cloud_name; + return "/res" + cloud_name; } let shared_domain = !private_cdn; if (secure) { - if ((secure_distribution == null) || secure_distribution === OLD_AKAMAI_SHARED_CDN) { + if (secure_distribution == null || secure_distribution === OLD_AKAMAI_SHARED_CDN) { secure_distribution = private_cdn ? cloud_name + "-res.cloudinary.com" : SHARED_CDN; } if (shared_domain == null) { shared_domain = secure_distribution === SHARED_CDN; } - prefix = 'https://' + secure_distribution; + prefix = "https://" + secure_distribution; } else if (cname) { // let subdomain = cdn_subdomain ? 'a' + ((crc32(source) % 5) + 1) + '.' : ''; - prefix = 'http://' + cname; + prefix = "http://" + cname; } else { - let cdn_part = private_cdn ? cloud_name + '-' : ''; - let host = [cdn_part, 'res', '.cloudinary.com'].join(''); + let cdn_part = private_cdn ? cloud_name + "-" : ""; + let host = [cdn_part, "res", ".cloudinary.com"].join(""); - prefix = 'http://' + host; + prefix = "http://" + host; } if (shared_domain) { - prefix += '/' + cloud_name; + prefix += "/" + cloud_name; } return prefix; } diff --git a/src/index.ts b/src/index.ts index 00ffd23..40fd40b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,7 @@ -export {Transformation} from "./transformation/Transformation.js"; -export {ImageTransformation} from "./transformation/ImageTransformation.js"; -export {VideoTransformation} from "./transformation/VideoTransformation.js"; - -export {createCloudinaryLegacyURL} from "./backwards/createCloudinaryLegacyURL.js"; -export * as Actions from './actions.js'; -export * as Qualifiers from './qualifiers.js'; +export { Transformation } from "./transformation/Transformation.js"; +export { ImageTransformation } from "./transformation/ImageTransformation.js"; +export { VideoTransformation } from "./transformation/VideoTransformation.js"; +export { createCloudinaryLegacyURL } from "./backwards/createCloudinaryLegacyURL.js"; +export * as Actions from "./actions.js"; +export * as Qualifiers from "./qualifiers.js"; diff --git a/src/internal/Action.ts b/src/internal/Action.ts index 63b3def..7e4fbf6 100644 --- a/src/internal/Action.ts +++ b/src/internal/Action.ts @@ -1,8 +1,8 @@ -import {FlagQualifier} from "../qualifiers/flag/FlagQualifier.js"; -import {Qualifier} from "./qualifier/Qualifier.js"; -import {mapToSortedArray} from "./utils/dataStructureUtils.js"; -import {FlagTypes} from "../types/types.js"; -import {ActionModel} from "./models/ActionModel.js"; +import { FlagQualifier } from "../qualifiers/flag/FlagQualifier.js"; +import { Qualifier } from "./qualifier/Qualifier.js"; +import { mapToSortedArray } from "./utils/dataStructureUtils.js"; +import { FlagTypes } from "../types/types.js"; +import { ActionModel } from "./models/ActionModel.js"; /** * @summary SDK @@ -18,10 +18,10 @@ class Action extends ActionModel { // If the falgs are added to the qualifiers map, only a single flag could exist in a component (it's a map) // So flags are stored separately until the very end because of that reason flags: FlagQualifier[] = []; - private delimiter = ','; // {qualifier}{delimiter}{qualifier} for example: `${'w_100'}${','}${'c_fill'}` + private delimiter = ","; // {qualifier}{delimiter}{qualifier} for example: `${'w_100'}${','}${'c_fill'}` protected prepareQualifiers(): void {} - private actionTag = ''; // A custom name tag to identify this action in the future + private actionTag = ""; // A custom name tag to identify this action in the future /** * @description Returns the custom name tag that was given to this action @@ -56,18 +56,16 @@ class Action extends ActionModel { */ addQualifier(qualifier: Qualifier | string): this { // if string, find the key and value - if (typeof qualifier === 'string') { - const [key, value] = qualifier.toLowerCase().split('_'); + if (typeof qualifier === "string") { + const [key, value] = qualifier.toLowerCase().split("_"); - - if (key === 'fl') { + if (key === "fl") { // if string qualifier is a flag, store it in the flags arrays this.flags.push(new FlagQualifier(value)); } else { // if the string qualifier is not a flag, create a new qualifier from it this.qualifiers.set(key, new Qualifier(key, value)); } - } else { // if a qualifier object, insert to the qualifiers map this.qualifiers.set(qualifier.key, qualifier); @@ -82,7 +80,7 @@ class Action extends ActionModel { * @return {this} */ addFlag(flag: FlagTypes | FlagQualifier | string): this { - if (typeof flag === 'string') { + if (typeof flag === "string") { this.flags.push(new FlagQualifier(flag)); } else { if (flag instanceof FlagQualifier) { @@ -100,4 +98,4 @@ class Action extends ActionModel { } } -export {Action}; +export { Action }; diff --git a/src/internal/RawAction.ts b/src/internal/RawAction.ts index a1868dc..ef5e5a5 100644 --- a/src/internal/RawAction.ts +++ b/src/internal/RawAction.ts @@ -1,6 +1,6 @@ -import {IActionModel} from "./models/IActionModel.js"; -import {IErrorObject} from "./models/IErrorObject.js"; -import {createUnsupportedError} from "./utils/unsupportedError.js"; +import { IActionModel } from "./models/IActionModel.js"; +import { IErrorObject } from "./models/IErrorObject.js"; +import { createUnsupportedError } from "./utils/unsupportedError.js"; /** * @summary SDK @@ -19,9 +19,11 @@ class RawAction { return this.raw; } - toJson(): IActionModel | IErrorObject{ - return {error: createUnsupportedError(`unsupported action ${this.constructor.name}`)}; + toJson(): IActionModel | IErrorObject { + return { + error: createUnsupportedError(`unsupported action ${this.constructor.name}`), + }; } } -export {RawAction}; +export { RawAction }; diff --git a/src/internal/fromJson.ts b/src/internal/fromJson.ts index 0ee17af..2844c0c 100644 --- a/src/internal/fromJson.ts +++ b/src/internal/fromJson.ts @@ -6,10 +6,7 @@ import { IActionModel } from "./models/IActionModel.js"; import { Action } from "./Action.js"; import { IErrorObject } from "./models/IErrorObject.js"; import { createUnsupportedError } from "./utils/unsupportedError.js"; -import { - IHasFromJson, - ITransformationFromJson, -} from "./models/IHasFromJson.js"; +import { IHasFromJson, ITransformationFromJson } from "./models/IHasFromJson.js"; import { ResizeMinimumFitAction } from "../actions/resize/ResizeMinimumFitAction.js"; import { ResizeCropAction } from "../actions/resize/ResizeCropAction.js"; import { OpacityAdjustAction } from "../actions/adjust/OpacityAdjustAction.js"; @@ -153,15 +150,10 @@ function actions(actionModels: IActionModel[]): Action[] { return actionModels.map((actionModel) => { const actionClass = ActionModelMap[actionModel.actionType]; if (!actionClass) { - throw createUnsupportedError( - `unsupported action ${actionModel.actionType}` - ); + throw createUnsupportedError(`unsupported action ${actionModel.actionType}`); } - return actionClass.fromJson( - actionModel, - fromJson as unknown as ITransformationFromJson - ); + return actionClass.fromJson(actionModel, fromJson as unknown as ITransformationFromJson); }); } @@ -169,15 +161,11 @@ function actions(actionModels: IActionModel[]): Action[] { * Return array of action instances represented by given action models. * @param transformationModel */ -function fromJson( - transformationModel: ITransformationModel -): Transformation | IErrorObject { +function fromJson(transformationModel: ITransformationModel): Transformation | IErrorObject { try { // Create a new Transformation and add all actions to it const transformation = new Transformation(); - actions(transformationModel.actions).forEach((action) => - transformation.addAction(action) - ); + actions(transformationModel.actions).forEach((action) => transformation.addAction(action)); return transformation; } catch (error) { return { error }; diff --git a/src/internal/internalConstants.ts b/src/internal/internalConstants.ts index ac4e454..a8fc102 100644 --- a/src/internal/internalConstants.ts +++ b/src/internal/internalConstants.ts @@ -3,7 +3,7 @@ * It is not intended for public use and is not part of the public API */ -import {objectFlip} from "./utils/objectFlip.js"; +import { objectFlip } from "./utils/objectFlip.js"; export const CONDITIONAL_OPERATORS = { "=": "eq", @@ -18,103 +18,104 @@ export const CONDITIONAL_OPERATORS = { "/": "div", "+": "add", "-": "sub", - "^": "pow" + "^": "pow", }; export const RESERVED_NAMES = { - "aspect_ratio": "ar", - "aspectRatio": "ar", - "current_page": "cp", - "currentPage": "cp", - "duration": "du", - "face_count": "fc", - "faceCount": "fc", - "height": "h", - "initial_aspect_ratio": "iar", - "initial_height": "ih", - "initial_width": "iw", - "initialAspectRatio": "iar", - "initialHeight": "ih", - "initialWidth": "iw", - "initial_duration": "idu", - "initialDuration": "idu", - "page_count": "pc", - "page_x": "px", - "page_y": "py", - "pageCount": "pc", - "pageX": "px", - "pageY": "py", - "tags": "tags", - "width": "w", - "trimmed_aspect_ratio": "tar", - "current_public_id": "cpi", - "initial_density": "idn", - "page_names": "pgnames" + aspect_ratio: "ar", + aspectRatio: "ar", + current_page: "cp", + currentPage: "cp", + duration: "du", + face_count: "fc", + faceCount: "fc", + height: "h", + initial_aspect_ratio: "iar", + initial_height: "ih", + initial_width: "iw", + initialAspectRatio: "iar", + initialHeight: "ih", + initialWidth: "iw", + initial_duration: "idu", + initialDuration: "idu", + page_count: "pc", + page_x: "px", + page_y: "py", + pageCount: "pc", + pageX: "px", + pageY: "py", + tags: "tags", + width: "w", + trimmed_aspect_ratio: "tar", + current_public_id: "cpi", + initial_density: "idn", + page_names: "pgnames", }; export const ACTION_TYPE_TO_CROP_MODE_MAP: Record = { - limitFit: 'limit', - limitFill: 'lfill', - minimumFit: 'mfit', - thumbnail: 'thumb', - limitPad: 'lpad', - minimumPad: 'mpad' + limitFit: "limit", + limitFill: "lfill", + minimumFit: "mfit", + thumbnail: "thumb", + limitPad: "lpad", + minimumPad: "mpad", }; export const ACTION_TYPE_TO_DELIVERY_MODE_MAP: Record = { - colorSpace: 'cs', - dpr: 'dpr', - density: 'dn', - defaultImage: 'd', - format: 'f', - quality: 'q' + colorSpace: "cs", + dpr: "dpr", + density: "dn", + defaultImage: "d", + format: "f", + quality: "q", }; export const ACTION_TYPE_TO_EFFECT_MODE_MAP: Record = { - redEye: 'redeye', - advancedRedEye: 'adv_redeye', - oilPaint: 'oil_paint', - unsharpMask: 'unsharp_mask', - makeTransparent: 'make_transparent' + redEye: "redeye", + advancedRedEye: "adv_redeye", + oilPaint: "oil_paint", + unsharpMask: "unsharp_mask", + makeTransparent: "make_transparent", }; export const ACTION_TYPE_TO_QUALITY_MODE_MAP: Record = { - autoBest: 'auto:best', - autoEco: 'auto:eco', - autoGood: 'auto:good', - autoLow: 'auto:low', - jpegminiHigh: 'jpegmini:1', - jpegminiMedium: 'jpegmini:2', - jpegminiBest: 'jpegmini:0' + autoBest: "auto:best", + autoEco: "auto:eco", + autoGood: "auto:good", + autoLow: "auto:low", + jpegminiHigh: "jpegmini:1", + jpegminiMedium: "jpegmini:2", + jpegminiBest: "jpegmini:0", }; export const ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP: Record = { - fullHd: 'full_hd', - fullHdWifi: 'full_hd_wifi', - fullHdLean: 'full_hd_lean', - hdLean: 'hd_lean' - + fullHd: "full_hd", + fullHdWifi: "full_hd_wifi", + fullHdLean: "full_hd_lean", + hdLean: "hd_lean", }; export const CHROMA_VALUE_TO_CHROMA_MODEL_ENUM: Record = { 444: "CHROMA_444", - 420: "CHROMA_420" + 420: "CHROMA_420", }; export const COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP: Record = { - 'noCmyk': 'no_cmyk', - 'keepCmyk': 'keep_cmyk', - 'tinySrgb': 'tinysrgb', - 'srgbTrueColor': 'srgb:truecolor' + noCmyk: "no_cmyk", + keepCmyk: "keep_cmyk", + tinySrgb: "tinysrgb", + srgbTrueColor: "srgb:truecolor", }; export const ACTION_TYPE_TO_BLEND_MODE_MAP: Record = { - 'antiRemoval': 'anti_removal' + antiRemoval: "anti_removal", }; export const CHROMA_MODEL_ENUM_TO_CHROMA_VALUE = objectFlip(CHROMA_VALUE_TO_CHROMA_MODEL_ENUM); -export const COLOR_SPACE_MODE_TO_COLOR_SPACE_MODEL_MODE_MAP = objectFlip(COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP); +export const COLOR_SPACE_MODE_TO_COLOR_SPACE_MODEL_MODE_MAP = objectFlip( + COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP +); export const CROP_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_CROP_MODE_MAP); @@ -125,4 +126,3 @@ export const EFFECT_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_EFFECT_M export const QUALITY_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_QUALITY_MODE_MAP); export const STREAMING_PROFILE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP); - diff --git a/src/internal/models/ActionModel.ts b/src/internal/models/ActionModel.ts index 0f50f84..bb7c50f 100644 --- a/src/internal/models/ActionModel.ts +++ b/src/internal/models/ActionModel.ts @@ -1,5 +1,5 @@ -import {IActionModel} from "./IActionModel.js"; -import {actionToJson} from "./actionToJson.js"; +import { IActionModel } from "./IActionModel.js"; +import { actionToJson } from "./actionToJson.js"; export class ActionModel { protected _actionModel: IActionModel; diff --git a/src/internal/models/IActionModel.ts b/src/internal/models/IActionModel.ts index 19c4971..2d584ea 100644 --- a/src/internal/models/IActionModel.ts +++ b/src/internal/models/IActionModel.ts @@ -7,9 +7,9 @@ interface IActionModel { * Validates obj is an instance of IActionModel * @param obj */ -function isIActionModel(obj: unknown): obj is IActionModel{ +function isIActionModel(obj: unknown): obj is IActionModel { const actionModel = obj as IActionModel; - return ('actionType' in actionModel); + return "actionType" in actionModel; } -export {IActionModel, isIActionModel}; \ No newline at end of file +export { IActionModel, isIActionModel }; diff --git a/src/internal/models/IAdjustActionModel.ts b/src/internal/models/IAdjustActionModel.ts index a917c2c..f6a2f14 100644 --- a/src/internal/models/IAdjustActionModel.ts +++ b/src/internal/models/IAdjustActionModel.ts @@ -1,8 +1,8 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; interface ImproveActionModel extends IActionModel { mode?: string; blend?: number; } -export {ImproveActionModel}; +export { ImproveActionModel }; diff --git a/src/internal/models/IBaseTextSourceModel.ts b/src/internal/models/IBaseTextSourceModel.ts index 1917486..b92158f 100644 --- a/src/internal/models/IBaseTextSourceModel.ts +++ b/src/internal/models/IBaseTextSourceModel.ts @@ -1,10 +1,10 @@ -import {ISourceModel} from "./ISourceModel.js"; -import {ITextStyleModel} from "./ITextStyleModel.js"; -import {IColorModel} from "./IColorModel.js"; -import {ITransformationModel} from "./ITransformationModel.js"; +import { ISourceModel } from "./ISourceModel.js"; +import { ITextStyleModel } from "./ITextStyleModel.js"; +import { IColorModel } from "./IColorModel.js"; +import { ITransformationModel } from "./ITransformationModel.js"; export interface ITextSourceModel extends ISourceModel { - sourceType: 'text' | 'subtitles'; + sourceType: "text" | "subtitles"; text: string; textStyle: ITextStyleModel; textColor?: IColorModel; @@ -17,5 +17,5 @@ export interface ITextSourceModel extends ISourceModel { * @param obj */ export function isITextSourceModel(obj: unknown): obj is ITextSourceModel { - return obj && (obj as ITextSourceModel).sourceType === 'text'; + return obj && (obj as ITextSourceModel).sourceType === "text"; } diff --git a/src/internal/models/IBorderActionModel.ts b/src/internal/models/IBorderActionModel.ts index e6f03b7..6e8ba86 100644 --- a/src/internal/models/IBorderActionModel.ts +++ b/src/internal/models/IBorderActionModel.ts @@ -1,5 +1,5 @@ -import {IActionModel} from "./IActionModel.js"; -import {CornerRadiusValueType} from "./IRoundCornersActionModel.js"; +import { IActionModel } from "./IActionModel.js"; +import { CornerRadiusValueType } from "./IRoundCornersActionModel.js"; interface IBorderActionModel extends IActionModel { width?: number | string; @@ -7,4 +7,4 @@ interface IBorderActionModel extends IActionModel { radius?: CornerRadiusValueType; } -export {IBorderActionModel}; +export { IBorderActionModel }; diff --git a/src/internal/models/IColorModel.ts b/src/internal/models/IColorModel.ts index 680eb5f..e067502 100644 --- a/src/internal/models/IColorModel.ts +++ b/src/internal/models/IColorModel.ts @@ -1,3 +1,3 @@ type IColorModel = string; -export {IColorModel}; \ No newline at end of file +export { IColorModel }; diff --git a/src/internal/models/IConcatenateActionModel.ts b/src/internal/models/IConcatenateActionModel.ts index 1fe7463..66423ee 100644 --- a/src/internal/models/IConcatenateActionModel.ts +++ b/src/internal/models/IConcatenateActionModel.ts @@ -1,10 +1,10 @@ -import {IActionModel} from "./IActionModel.js"; -import {IVideoSourceModel} from "./IVideoSourceModel.js"; -import {ISourceModel} from "./ISourceModel.js"; +import { IActionModel } from "./IActionModel.js"; +import { IVideoSourceModel } from "./IVideoSourceModel.js"; +import { ISourceModel } from "./ISourceModel.js"; -export interface IConcatenateActionModel extends IActionModel{ +export interface IConcatenateActionModel extends IActionModel { source: ISourceModel; // TODO: add and update source: IVideoSourceModel | IImageSourceModel | IFetchSourceModel - transition?: IVideoSourceModel, + transition?: IVideoSourceModel; prepend?: boolean; duration?: number; } diff --git a/src/internal/models/IConditionalActionModel.ts b/src/internal/models/IConditionalActionModel.ts index 1cea847..063349f 100644 --- a/src/internal/models/IConditionalActionModel.ts +++ b/src/internal/models/IConditionalActionModel.ts @@ -1,5 +1,5 @@ -import {IActionModel} from "./IActionModel.js"; -import {Transformation} from "../../transformation/Transformation.js"; +import { IActionModel } from "./IActionModel.js"; +import { Transformation } from "../../transformation/Transformation.js"; interface IConditionalActionModel extends IActionModel { expression?: string; @@ -7,4 +7,4 @@ interface IConditionalActionModel extends IActionModel { otherwise?: Transformation; } -export {IConditionalActionModel}; \ No newline at end of file +export { IConditionalActionModel }; diff --git a/src/internal/models/IDeliveryActionModel.ts b/src/internal/models/IDeliveryActionModel.ts index 7c7c0ed..1c084e0 100644 --- a/src/internal/models/IDeliveryActionModel.ts +++ b/src/internal/models/IDeliveryActionModel.ts @@ -1,40 +1,49 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; type ColorSpaceModeType = "srgb" | "srgbTrueColor" | "tinySrgb" | "cmyk" | "noCmyk" | "keepCmyk"; -interface IDeliveryColorSpaceActionModel extends IActionModel{ - mode?: ColorSpaceModeType +interface IDeliveryColorSpaceActionModel extends IActionModel { + mode?: ColorSpaceModeType; } interface IDprModel extends IActionModel { - "dpr"?: number | string; + dpr?: number | string; } interface IDensityModel extends IActionModel { - "density": number | string; + density: number | string; } -interface IDefaultImageModel extends IActionModel{ - "publicId": string; +interface IDefaultImageModel extends IActionModel { + publicId: string; } -interface IDeliveryColorSpaceFromICCActionModel extends IActionModel{ +interface IDeliveryColorSpaceFromICCActionModel extends IActionModel { publicId?: string; } interface IDeliveryFormatModel extends IActionModel { - "formatType"?: string | number, - "lossy"?: boolean, - "progressive"?: { - "mode"?: string - }, - "preserveTransparency"?: boolean + formatType?: string | number; + lossy?: boolean; + progressive?: { + mode?: string; + }; + preserveTransparency?: boolean; } -interface IDeliveryQualityModel extends IActionModel{ - "level"?: string | number; - "chromaSubSampling"?: string; - "quantization"?: number; +interface IDeliveryQualityModel extends IActionModel { + level?: string | number; + chromaSubSampling?: string; + quantization?: number; } -export {ColorSpaceModeType, IDeliveryColorSpaceActionModel, IDprModel, IDensityModel, IDefaultImageModel, IDeliveryColorSpaceFromICCActionModel, IDeliveryFormatModel, IDeliveryQualityModel}; +export { + ColorSpaceModeType, + IDeliveryColorSpaceActionModel, + IDprModel, + IDensityModel, + IDefaultImageModel, + IDeliveryColorSpaceFromICCActionModel, + IDeliveryFormatModel, + IDeliveryQualityModel, +}; diff --git a/src/internal/models/IDimensionsModel.ts b/src/internal/models/IDimensionsModel.ts index 3d7930c..2cbbfee 100644 --- a/src/internal/models/IDimensionsModel.ts +++ b/src/internal/models/IDimensionsModel.ts @@ -4,4 +4,4 @@ interface IDimensionsModel { aspectRatio?: string | number; } -export {IDimensionsModel}; \ No newline at end of file +export { IDimensionsModel }; diff --git a/src/internal/models/IErrorObject.ts b/src/internal/models/IErrorObject.ts index fa7dcc3..b555b4c 100644 --- a/src/internal/models/IErrorObject.ts +++ b/src/internal/models/IErrorObject.ts @@ -1,4 +1,4 @@ -interface IErrorObject{ +interface IErrorObject { error: Error; } @@ -8,7 +8,7 @@ interface IErrorObject{ */ function isErrorObject(obj: unknown): obj is IErrorObject { const errorObj = obj as IErrorObject; - return ('error' in errorObj) && !!errorObj.error; + return "error" in errorObj && !!errorObj.error; } -export {IErrorObject, isErrorObject}; \ No newline at end of file +export { IErrorObject, isErrorObject }; diff --git a/src/internal/models/IFetchSourceModel.ts b/src/internal/models/IFetchSourceModel.ts index d54bc6f..4f8f639 100644 --- a/src/internal/models/IFetchSourceModel.ts +++ b/src/internal/models/IFetchSourceModel.ts @@ -1,8 +1,8 @@ -import {ISourceModel} from './ISourceModel.js'; -import {ITransformationModel} from "./ITransformationModel.js"; +import { ISourceModel } from "./ISourceModel.js"; +import { ITransformationModel } from "./ITransformationModel.js"; export interface IFetchSourceModel extends ISourceModel { - sourceType: 'fetch'; + sourceType: "fetch"; url: string; format?: string; transformation?: ITransformationModel; @@ -13,5 +13,5 @@ export interface IFetchSourceModel extends ISourceModel { * @param obj */ export function isIFetchSourceModel(obj: unknown): obj is IFetchSourceModel { - return obj && (obj as IFetchSourceModel).sourceType === 'fetch'; + return obj && (obj as IFetchSourceModel).sourceType === "fetch"; } diff --git a/src/internal/models/IHasFromJson.ts b/src/internal/models/IHasFromJson.ts index a2cd77b..e85b7f5 100644 --- a/src/internal/models/IHasFromJson.ts +++ b/src/internal/models/IHasFromJson.ts @@ -1,7 +1,7 @@ -import {IActionModel} from "./IActionModel.js"; -import {Action} from "../Action.js"; -import {Transformation} from "../../transformation/Transformation.js"; -import {ITransformationModel} from "./ITransformationModel.js"; +import { IActionModel } from "./IActionModel.js"; +import { Action } from "../Action.js"; +import { Transformation } from "../../transformation/Transformation.js"; +import { ITransformationModel } from "./ITransformationModel.js"; export type ITransformationFromJson = (transformationModel: ITransformationModel) => Transformation; diff --git a/src/internal/models/IImageSourceModel.ts b/src/internal/models/IImageSourceModel.ts index bb4aca8..3f256c6 100644 --- a/src/internal/models/IImageSourceModel.ts +++ b/src/internal/models/IImageSourceModel.ts @@ -1,5 +1,5 @@ -import {ISourceModel} from "./ISourceModel.js"; -import {ITransformationModel} from "./ITransformationModel.js"; +import { ISourceModel } from "./ISourceModel.js"; +import { ITransformationModel } from "./ITransformationModel.js"; export interface IImageSourceModel extends ISourceModel { sourceType: "image"; @@ -12,5 +12,5 @@ export interface IImageSourceModel extends ISourceModel { * @param obj */ export function isIImageSourceModel(obj: unknown): obj is IImageSourceModel { - return obj && (obj as IImageSourceModel).sourceType === 'image'; + return obj && (obj as IImageSourceModel).sourceType === "image"; } diff --git a/src/internal/models/IOpacityActionModel.ts b/src/internal/models/IOpacityActionModel.ts index 82e7799..697c0de 100644 --- a/src/internal/models/IOpacityActionModel.ts +++ b/src/internal/models/IOpacityActionModel.ts @@ -1,7 +1,7 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; interface OpacityActionModel extends IActionModel { level?: number; } -export {OpacityActionModel}; +export { OpacityActionModel }; diff --git a/src/internal/models/IOverlayActionModel.ts b/src/internal/models/IOverlayActionModel.ts index 854bd56..e9b0e60 100644 --- a/src/internal/models/IOverlayActionModel.ts +++ b/src/internal/models/IOverlayActionModel.ts @@ -1,12 +1,12 @@ -import {IActionModel} from "./IActionModel.js"; -import {ISourceModel} from "./ISourceModel.js"; -import {IPositionModel} from "./IPositionModel.js"; -import {ITimelinePositionModel} from "./ITimelinePositionModel.js"; +import { IActionModel } from "./IActionModel.js"; +import { ISourceModel } from "./ISourceModel.js"; +import { IPositionModel } from "./IPositionModel.js"; +import { ITimelinePositionModel } from "./ITimelinePositionModel.js"; export interface IOverlayActionModel extends IActionModel { - actionType: 'overlay' | 'underlay'; + actionType: "overlay" | "underlay"; source: ISourceModel; position?: IPositionModel; timelinePosition?: ITimelinePositionModel; - blendMode?: {blendModeType?: string, level?: number|string}; + blendMode?: { blendModeType?: string; level?: number | string }; } diff --git a/src/internal/models/IPositionModel.ts b/src/internal/models/IPositionModel.ts index 2c3842d..713247e 100644 --- a/src/internal/models/IPositionModel.ts +++ b/src/internal/models/IPositionModel.ts @@ -1,10 +1,10 @@ -import {IQualifierModel} from "./IQualifierModel.js"; -import {IGravityModel} from "./createGravityModel.js"; +import { IQualifierModel } from "./IQualifierModel.js"; +import { IGravityModel } from "./createGravityModel.js"; export interface IPositionModel extends IQualifierModel { offsetX?: number | string; offsetY?: number | string; tiled?: boolean; allowOverflow?: boolean; - gravity?: IGravityModel + gravity?: IGravityModel; } diff --git a/src/internal/models/IPreviewActionModel.ts b/src/internal/models/IPreviewActionModel.ts index 462bd3e..8dc67b8 100644 --- a/src/internal/models/IPreviewActionModel.ts +++ b/src/internal/models/IPreviewActionModel.ts @@ -1,6 +1,6 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; -export interface IPreviewActionModel extends IActionModel{ +export interface IPreviewActionModel extends IActionModel { duration?: number; maximumSegments?: number; minimumSegmentDuration?: number; diff --git a/src/internal/models/IResizeAdvancedActionModel.ts b/src/internal/models/IResizeAdvancedActionModel.ts index 215408b..f52b374 100644 --- a/src/internal/models/IResizeAdvancedActionModel.ts +++ b/src/internal/models/IResizeAdvancedActionModel.ts @@ -1,8 +1,8 @@ -import {IResizeSimpleActionModel} from "./IResizeSimpleActionModel.js"; -import {IGravityModel} from "./createGravityModel.js"; +import { IResizeSimpleActionModel } from "./IResizeSimpleActionModel.js"; +import { IGravityModel } from "./createGravityModel.js"; -interface IResizeAdvancedActionModel extends IResizeSimpleActionModel{ +interface IResizeAdvancedActionModel extends IResizeSimpleActionModel { gravity: IGravityModel; } -export {IResizeAdvancedActionModel}; \ No newline at end of file +export { IResizeAdvancedActionModel }; diff --git a/src/internal/models/IResizeSimpleActionModel.ts b/src/internal/models/IResizeSimpleActionModel.ts index 6fd5c85..387ec3c 100644 --- a/src/internal/models/IResizeSimpleActionModel.ts +++ b/src/internal/models/IResizeSimpleActionModel.ts @@ -1,10 +1,10 @@ -import {IActionModel} from "./IActionModel.js"; -import {IDimensionsModel} from "./IDimensionsModel.js"; +import { IActionModel } from "./IActionModel.js"; +import { IDimensionsModel } from "./IDimensionsModel.js"; -interface IResizeSimpleActionModel extends IActionModel{ +interface IResizeSimpleActionModel extends IActionModel { dimensions: IDimensionsModel; relative?: boolean; regionRelative?: boolean; } -export {IResizeSimpleActionModel}; \ No newline at end of file +export { IResizeSimpleActionModel }; diff --git a/src/internal/models/IRotateActionModel.ts b/src/internal/models/IRotateActionModel.ts index c2f6990..e121e72 100644 --- a/src/internal/models/IRotateActionModel.ts +++ b/src/internal/models/IRotateActionModel.ts @@ -1,7 +1,7 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; interface IRotateByAngleActionModel extends IActionModel { - angle?: number + angle?: number; } -export {IRotateByAngleActionModel}; +export { IRotateByAngleActionModel }; diff --git a/src/internal/models/IRoundCornersActionModel.ts b/src/internal/models/IRoundCornersActionModel.ts index e7224c7..3ddd39a 100644 --- a/src/internal/models/IRoundCornersActionModel.ts +++ b/src/internal/models/IRoundCornersActionModel.ts @@ -1,9 +1,9 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; -type CornerRadiusValueType = [number?, number?, number?, number?] | 'max'; +type CornerRadiusValueType = [number?, number?, number?, number?] | "max"; interface IRoundCornersActionModel extends IActionModel { radius?: CornerRadiusValueType; } -export {IRoundCornersActionModel, CornerRadiusValueType}; +export { IRoundCornersActionModel, CornerRadiusValueType }; diff --git a/src/internal/models/ISourceModel.ts b/src/internal/models/ISourceModel.ts index 154156d..6b278a0 100644 --- a/src/internal/models/ISourceModel.ts +++ b/src/internal/models/ISourceModel.ts @@ -1,4 +1,4 @@ -import {IQualifierModel} from "./IQualifierModel.js"; +import { IQualifierModel } from "./IQualifierModel.js"; export interface ISourceModel extends IQualifierModel { sourceType: string; diff --git a/src/internal/models/IStrokeModel.ts b/src/internal/models/IStrokeModel.ts index 827e85c..138c846 100644 --- a/src/internal/models/IStrokeModel.ts +++ b/src/internal/models/IStrokeModel.ts @@ -1,7 +1,7 @@ -import {IQualifierModel} from "./IQualifierModel.js"; -import {IColorModel} from "./IColorModel.js"; +import { IQualifierModel } from "./IQualifierModel.js"; +import { IColorModel } from "./IColorModel.js"; -export interface ISolidStrokeModel extends IQualifierModel{ +export interface ISolidStrokeModel extends IQualifierModel { width: number | string; color: IColorModel; } @@ -12,6 +12,8 @@ export type IStrokeModel = boolean | ISolidStrokeModel; * Validate that obj is an ISolidStrokeModel * @param obj */ -export function isISolidStrokeModel(obj: unknown): obj is ISolidStrokeModel{ - return typeof obj === 'object' && (obj as ISolidStrokeModel).width != null && (obj as ISolidStrokeModel).color != null; +export function isISolidStrokeModel(obj: unknown): obj is ISolidStrokeModel { + return ( + typeof obj === "object" && (obj as ISolidStrokeModel).width != null && (obj as ISolidStrokeModel).color != null + ); } diff --git a/src/internal/models/ISubtitlesSourceModel.ts b/src/internal/models/ISubtitlesSourceModel.ts index 057fdc1..8ee3a85 100644 --- a/src/internal/models/ISubtitlesSourceModel.ts +++ b/src/internal/models/ISubtitlesSourceModel.ts @@ -1,9 +1,9 @@ -import {ITextStyleModel} from "./ITextStyleModel.js"; -import {IBaseTextSourceModel} from "./ITextSourceModel.js"; +import { ITextStyleModel } from "./ITextStyleModel.js"; +import { IBaseTextSourceModel } from "./ITextSourceModel.js"; export interface ISubtitlesSourceModel extends IBaseTextSourceModel { textStyle?: ITextStyleModel; - sourceType: 'subtitles'; + sourceType: "subtitles"; publicId: string; } @@ -12,5 +12,5 @@ export interface ISubtitlesSourceModel extends IBaseTextSourceModel { * @param obj */ export function isISubtitlesSourceModel(obj: unknown): obj is ISubtitlesSourceModel { - return obj && (obj as ISubtitlesSourceModel).sourceType === 'subtitles'; + return obj && (obj as ISubtitlesSourceModel).sourceType === "subtitles"; } diff --git a/src/internal/models/ITextSourceModel.ts b/src/internal/models/ITextSourceModel.ts index ebd6dbb..21edf35 100644 --- a/src/internal/models/ITextSourceModel.ts +++ b/src/internal/models/ITextSourceModel.ts @@ -1,7 +1,7 @@ -import {ISourceModel} from "./ISourceModel.js"; -import {ITextStyleModel} from "./ITextStyleModel.js"; -import {IColorModel} from "./IColorModel.js"; -import {ITransformationModel} from "./ITransformationModel.js"; +import { ISourceModel } from "./ISourceModel.js"; +import { ITextStyleModel } from "./ITextStyleModel.js"; +import { IColorModel } from "./IColorModel.js"; +import { ITransformationModel } from "./ITransformationModel.js"; export interface IBaseTextSourceModel extends ISourceModel { textColor?: IColorModel; @@ -9,9 +9,9 @@ export interface IBaseTextSourceModel extends ISourceModel { transformation?: ITransformationModel; } -export interface ITextSourceModel extends IBaseTextSourceModel{ +export interface ITextSourceModel extends IBaseTextSourceModel { textStyle: ITextStyleModel; - sourceType: 'text'; + sourceType: "text"; text: string; } @@ -20,5 +20,5 @@ export interface ITextSourceModel extends IBaseTextSourceModel{ * @param obj */ export function isITextSourceModel(obj: unknown): obj is ITextSourceModel { - return obj && (obj as ITextSourceModel).sourceType === 'text'; + return obj && (obj as ITextSourceModel).sourceType === "text"; } diff --git a/src/internal/models/ITextStyleModel.ts b/src/internal/models/ITextStyleModel.ts index 0ad624b..da0c0fa 100644 --- a/src/internal/models/ITextStyleModel.ts +++ b/src/internal/models/ITextStyleModel.ts @@ -1,5 +1,5 @@ -import {IQualifierModel} from "./IQualifierModel.js"; -import {IStrokeModel} from "./IStrokeModel.js"; +import { IQualifierModel } from "./IQualifierModel.js"; +import { IStrokeModel } from "./IStrokeModel.js"; export interface ITextStyleModel extends IQualifierModel { fontFamily: string; diff --git a/src/internal/models/ITimelinePositionModel.ts b/src/internal/models/ITimelinePositionModel.ts index ec280e1..78c68db 100644 --- a/src/internal/models/ITimelinePositionModel.ts +++ b/src/internal/models/ITimelinePositionModel.ts @@ -1,4 +1,4 @@ -import {IQualifierModel} from "./IQualifierModel.js"; +import { IQualifierModel } from "./IQualifierModel.js"; export interface ITimelinePositionModel extends IQualifierModel { startOffset?: number | string; diff --git a/src/internal/models/ITranscodeActionModel.ts b/src/internal/models/ITranscodeActionModel.ts index 42e4834..12f05cc 100644 --- a/src/internal/models/ITranscodeActionModel.ts +++ b/src/internal/models/ITranscodeActionModel.ts @@ -1,15 +1,15 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; -interface IKeyframeIntervalsActionModel extends IActionModel{ +interface IKeyframeIntervalsActionModel extends IActionModel { interval?: number | string; } -interface IFPSActionModel extends IActionModel{ +interface IFPSActionModel extends IActionModel { fps?: number; } -interface IFPSRangeActionModel extends IActionModel{ - fps?: {from: number; to?: number} +interface IFPSRangeActionModel extends IActionModel { + fps?: { from: number; to?: number }; } interface IBitRateActionModel extends IActionModel { @@ -17,26 +17,30 @@ interface IBitRateActionModel extends IActionModel { constant?: boolean; } -interface IAudioCodecActionModel extends IActionModel{ +interface IAudioCodecActionModel extends IActionModel { audioCodec?: string; } -interface IAudioFrequencyActionModel extends IActionModel{ +interface IAudioFrequencyActionModel extends IActionModel { audioFrequencyType?: string; } -interface IStreamingProfileActionModel extends IActionModel{ +interface IStreamingProfileActionModel extends IActionModel { profile?: string; } -interface IToAnimatedActionModel extends IActionModel{ +interface IToAnimatedActionModel extends IActionModel { animatedFormat?: string; sampling?: string | number; delay?: number; } -interface IVideoCodecActionModel extends IActionModel{ - videoCodec?: {videoCodecName?: string; profile?: string; level?: string | number} +interface IVideoCodecActionModel extends IActionModel { + videoCodec?: { + videoCodecName?: string; + profile?: string; + level?: string | number; + }; } export { @@ -48,5 +52,5 @@ export { IAudioFrequencyActionModel, IStreamingProfileActionModel, IToAnimatedActionModel, - IVideoCodecActionModel + IVideoCodecActionModel, }; diff --git a/src/internal/models/ITransformationModel.ts b/src/internal/models/ITransformationModel.ts index b597bd2..cdc9979 100644 --- a/src/internal/models/ITransformationModel.ts +++ b/src/internal/models/ITransformationModel.ts @@ -1,5 +1,5 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; -export interface ITransformationModel{ +export interface ITransformationModel { actions: IActionModel[]; } diff --git a/src/internal/models/ITrimActionModel.ts b/src/internal/models/ITrimActionModel.ts index f2e64c0..1b5c8a9 100644 --- a/src/internal/models/ITrimActionModel.ts +++ b/src/internal/models/ITrimActionModel.ts @@ -1,6 +1,6 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; -export interface ITrimActionModel extends IActionModel{ +export interface ITrimActionModel extends IActionModel { duration?: string | number; startOffset?: number; endOffset?: number; diff --git a/src/internal/models/IVideoSourceModel.ts b/src/internal/models/IVideoSourceModel.ts index 7f67e51..781a166 100644 --- a/src/internal/models/IVideoSourceModel.ts +++ b/src/internal/models/IVideoSourceModel.ts @@ -1,5 +1,5 @@ -import {ISourceModel} from "./ISourceModel.js"; -import {ITransformationModel} from "./ITransformationModel.js"; +import { ISourceModel } from "./ISourceModel.js"; +import { ITransformationModel } from "./ITransformationModel.js"; export interface IVideoSourceModel extends ISourceModel { sourceType: "video"; diff --git a/src/internal/models/IVolumeActionModel.ts b/src/internal/models/IVolumeActionModel.ts index 89da8c9..48ea3f9 100644 --- a/src/internal/models/IVolumeActionModel.ts +++ b/src/internal/models/IVolumeActionModel.ts @@ -1,21 +1,21 @@ -import {IActionModel} from "./IActionModel.js"; +import { IActionModel } from "./IActionModel.js"; -export interface IVolumeByDecibelsModel{ - mode: 'decibels' +export interface IVolumeByDecibelsModel { + mode: "decibels"; value: number; } -export interface IVolumeByPercentModel{ - mode: 'percent' +export interface IVolumeByPercentModel { + mode: "percent"; value: number; } -export interface IVolumeMuteModel{ - mode: 'mute' +export interface IVolumeMuteModel { + mode: "mute"; } export type IVolumeValueModel = IVolumeByDecibelsModel | IVolumeByPercentModel | IVolumeMuteModel; -export interface IVolumeActionModel extends IActionModel{ - volumeValue: IVolumeValueModel +export interface IVolumeActionModel extends IActionModel { + volumeValue: IVolumeValueModel; } diff --git a/src/internal/models/QualifierModel.ts b/src/internal/models/QualifierModel.ts index a9e8721..c10337a 100644 --- a/src/internal/models/QualifierModel.ts +++ b/src/internal/models/QualifierModel.ts @@ -1,5 +1,5 @@ -import {IQualifierModel} from "./IQualifierModel.js"; -import {IQualifierToJson, qualifierToJson} from "./qualifierToJson.js"; +import { IQualifierModel } from "./IQualifierModel.js"; +import { IQualifierToJson, qualifierToJson } from "./qualifierToJson.js"; export class QualifierModel { protected _qualifierModel: IQualifierModel; diff --git a/src/internal/models/actionToJson.ts b/src/internal/models/actionToJson.ts index 6da4307..e2b43b0 100644 --- a/src/internal/models/actionToJson.ts +++ b/src/internal/models/actionToJson.ts @@ -1,6 +1,6 @@ -import {IActionModel} from "./IActionModel.js"; -import {IErrorObject} from "./IErrorObject.js"; -import {createUnsupportedError} from "../utils/unsupportedError.js"; +import { IActionModel } from "./IActionModel.js"; +import { IErrorObject } from "./IErrorObject.js"; +import { createUnsupportedError } from "../utils/unsupportedError.js"; export type IActionToJson = IActionModel | IErrorObject; /** @@ -19,5 +19,7 @@ export function actionToJson(): IActionToJson { return this._actionModel; } - return {error: createUnsupportedError(`unsupported action ${this.constructor.name}`)}; + return { + error: createUnsupportedError(`unsupported action ${this.constructor.name}`), + }; } diff --git a/src/internal/models/createBackgroundFromModel.ts b/src/internal/models/createBackgroundFromModel.ts index c891874..1ec7c88 100644 --- a/src/internal/models/createBackgroundFromModel.ts +++ b/src/internal/models/createBackgroundFromModel.ts @@ -1,4 +1,4 @@ -import {BackgroundQualifier} from "../../qualifiers/background/shared/base/BackgroundQualifier.js"; +import { BackgroundQualifier } from "../../qualifiers/background/shared/base/BackgroundQualifier.js"; import { IBackgroundModel, IBlurredBackgroundModel, @@ -7,20 +7,20 @@ import { IColorBackgroundModel, IGenerativeFillBackgroundModel, IPredominantBackgroundModel, - IPredominantGradientBackgroundModel + IPredominantGradientBackgroundModel, } from "./createBackgroundModel.js"; -import {Background} from "../../qualifiers.js"; -import {BackgroundBorderGradientQualifier} from "../../qualifiers/background/shared/gradient/BackgroundBorderGradientQualifier.js"; -import {auto, border, borderGradient, color, predominant, predominantGradient} from "../../qualifiers/background.js"; -import {BackgroundAutoPredominantQualifier} from "../../qualifiers/background/shared/auto/BackgroundAutoPredominantQualifier.js"; -import {BackgroundGenerativeFillQualifier} from "../../qualifiers/background/shared/BackgroundGenerativeFillQualifier.js"; +import { Background } from "../../qualifiers.js"; +import { BackgroundBorderGradientQualifier } from "../../qualifiers/background/shared/gradient/BackgroundBorderGradientQualifier.js"; +import { auto, border, borderGradient, color, predominant, predominantGradient } from "../../qualifiers/background.js"; +import { BackgroundAutoPredominantQualifier } from "../../qualifiers/background/shared/auto/BackgroundAutoPredominantQualifier.js"; +import { BackgroundGenerativeFillQualifier } from "../../qualifiers/background/shared/BackgroundGenerativeFillQualifier.js"; /** * Create BackgroundQualifier from IBlurredBackgroundModel * @param backgroundModel */ function createBlurredBackground(backgroundModel: IBlurredBackgroundModel): BackgroundQualifier { - const {brightness, intensity} = backgroundModel; + const { brightness, intensity } = backgroundModel; const result = Background.blurred(); if (brightness || brightness == 0) { @@ -39,8 +39,11 @@ function createBlurredBackground(backgroundModel: IBlurredBackgroundModel): Back * @param background * @param backgroundModel */ -function createGradientBackground(background: BackgroundBorderGradientQualifier, backgroundModel: IBorderGradientBackgroundModel | IPredominantGradientBackgroundModel) { - const {gradientColors, gradientDirection, contrast, palette} = backgroundModel; +function createGradientBackground( + background: BackgroundBorderGradientQualifier, + backgroundModel: IBorderGradientBackgroundModel | IPredominantGradientBackgroundModel +) { + const { gradientColors, gradientDirection, contrast, palette } = backgroundModel; if (contrast) { background.contrast(); @@ -66,8 +69,11 @@ function createGradientBackground(background: BackgroundBorderGradientQualifier, * @param background * @param backgroundModel */ -function createContrastPaletteBackground(background: BackgroundAutoPredominantQualifier, backgroundModel: IPredominantBackgroundModel | IBorderBackgroundModel) { - const {contrast, palette} = backgroundModel; +function createContrastPaletteBackground( + background: BackgroundAutoPredominantQualifier, + backgroundModel: IPredominantBackgroundModel | IBorderBackgroundModel +) { + const { contrast, palette } = backgroundModel; if (contrast) { background.contrast(); @@ -93,26 +99,26 @@ function createGenerativeFillBackground(backgroundModel: IGenerativeFillBackgrou * @param backgroundModel */ function createBackgroundFromModel(backgroundModel: IBackgroundModel): BackgroundQualifier { - const {backgroundType} = backgroundModel; + const { backgroundType } = backgroundModel; switch (backgroundType) { - case 'auto': + case "auto": return auto(); - case 'blurred': + case "blurred": return createBlurredBackground(backgroundModel as IBlurredBackgroundModel); - case 'border': + case "border": return createContrastPaletteBackground(border(), backgroundModel as IBorderBackgroundModel); - case 'borderGradient': + case "borderGradient": return createGradientBackground(borderGradient(), backgroundModel as IBorderGradientBackgroundModel); - case 'predominant': + case "predominant": return createContrastPaletteBackground(predominant(), backgroundModel as IPredominantBackgroundModel); - case 'predominantGradient': + case "predominantGradient": return createGradientBackground(predominantGradient(), backgroundModel as IPredominantGradientBackgroundModel); - case 'generativeFill': + case "generativeFill": return createGenerativeFillBackground(backgroundModel as IGenerativeFillBackgroundModel); default: return color((backgroundModel as IColorBackgroundModel).color); } } -export {createBackgroundFromModel}; +export { createBackgroundFromModel }; diff --git a/src/internal/models/createBackgroundModel.ts b/src/internal/models/createBackgroundModel.ts index 758af50..cbaf695 100644 --- a/src/internal/models/createBackgroundModel.ts +++ b/src/internal/models/createBackgroundModel.ts @@ -1,12 +1,12 @@ import BlurredBackgroundAction from "../../qualifiers/background/shared/BlurredBackgroundAction.js"; -import {IColorModel} from "./IColorModel.js"; -import {BackgroundAutoBorderQualifier} from "../../qualifiers/background/shared/auto/BackgroundAutoBorderQualifier.js"; -import {BackgroundBorderGradientQualifier} from "../../qualifiers/background/shared/gradient/BackgroundBorderGradientQualifier.js"; -import {GradientDirectionType} from "../../types/types.js"; -import {BackgroundColor} from "../../actions/background/actions/BackgroundColor.js"; -import {BackgroundPredominantGradientQualifier} from "../../qualifiers/background/shared/gradient/BackgroundPredominantGradientQualifier.js"; -import {BackgroundAutoPredominantQualifier} from "../../qualifiers/background/shared/auto/BackgroundAutoPredominantQualifier.js"; -import {BackgroundGenerativeFillQualifier} from "../../qualifiers/background/shared/BackgroundGenerativeFillQualifier.js"; +import { IColorModel } from "./IColorModel.js"; +import { BackgroundAutoBorderQualifier } from "../../qualifiers/background/shared/auto/BackgroundAutoBorderQualifier.js"; +import { BackgroundBorderGradientQualifier } from "../../qualifiers/background/shared/gradient/BackgroundBorderGradientQualifier.js"; +import { GradientDirectionType } from "../../types/types.js"; +import { BackgroundColor } from "../../actions/background/actions/BackgroundColor.js"; +import { BackgroundPredominantGradientQualifier } from "../../qualifiers/background/shared/gradient/BackgroundPredominantGradientQualifier.js"; +import { BackgroundAutoPredominantQualifier } from "../../qualifiers/background/shared/auto/BackgroundAutoPredominantQualifier.js"; +import { BackgroundGenerativeFillQualifier } from "../../qualifiers/background/shared/BackgroundGenerativeFillQualifier.js"; type IGradientColors = number | string; @@ -15,11 +15,11 @@ interface IBackgroundModel { } interface IAutoBackgroundModel extends IBackgroundModel { - backgroundType: 'auto'; + backgroundType: "auto"; } interface IBlurredBackgroundModel extends IBackgroundModel { - backgroundType: 'blurred'; + backgroundType: "blurred"; intensity?: number; brightness?: number; } @@ -30,7 +30,7 @@ interface IContrastPaletteBackgroundModel extends IBackgroundModel { } interface IBorderBackgroundModel extends IContrastPaletteBackgroundModel { - backgroundType: 'border'; + backgroundType: "border"; } interface IBaseGradientBackgroundModel extends IContrastPaletteBackgroundModel { @@ -39,24 +39,24 @@ interface IBaseGradientBackgroundModel extends IContrastPaletteBackgroundModel { } interface IBorderGradientBackgroundModel extends IBaseGradientBackgroundModel { - backgroundType: 'borderGradient'; + backgroundType: "borderGradient"; } interface IColorBackgroundModel extends IBackgroundModel { - backgroundType: 'color'; + backgroundType: "color"; color: IColorModel; } interface IPredominantBackgroundModel extends IContrastPaletteBackgroundModel { - backgroundType: 'predominant'; + backgroundType: "predominant"; } interface IPredominantGradientBackgroundModel extends IBaseGradientBackgroundModel { - backgroundType: 'predominantGradient'; + backgroundType: "predominantGradient"; } interface IGenerativeFillBackgroundModel { - backgroundType: 'generativeFill'; + backgroundType: "generativeFill"; prompt?: string; } @@ -65,14 +65,14 @@ interface IGenerativeFillBackgroundModel { * @param background */ function getBackgroundValue(background: unknown): string { - return `${background}`.replace('b_', ''); + return `${background}`.replace("b_", ""); } /** * Create an IAutoBackgroundModel from given background */ function createAutoBackgroundModel(): IAutoBackgroundModel { - return {backgroundType: 'auto'}; + return { backgroundType: "auto" }; } /** @@ -80,13 +80,13 @@ function createAutoBackgroundModel(): IAutoBackgroundModel { * @param background */ function createBlurredBackgroundModel(background: BlurredBackgroundAction): IBlurredBackgroundModel { - const { - intensityLevel, - brightnessLevel - } = background as unknown as { intensityLevel: number, brightnessLevel: number }; + const { intensityLevel, brightnessLevel } = background as unknown as { + intensityLevel: number; + brightnessLevel: number; + }; const result: IBlurredBackgroundModel = { - backgroundType: 'blurred' + backgroundType: "blurred", }; if (intensityLevel || intensityLevel === 0) { @@ -104,12 +104,14 @@ function createBlurredBackgroundModel(background: BlurredBackgroundAction): IBlu * Create an IContrastPaletteBackgroundModel from given background * @param background */ -function createContrastPaletteBackgroundModel(background: BackgroundAutoBorderQualifier): IContrastPaletteBackgroundModel { +function createContrastPaletteBackgroundModel( + background: BackgroundAutoBorderQualifier +): IContrastPaletteBackgroundModel { const contrast = (background as unknown as { _contrast: boolean })._contrast; const palette: IColorModel[] = (background as unknown as { _palette: IColorModel[] })._palette; const result = { - backgroundType: '' + backgroundType: "", } as IContrastPaletteBackgroundModel; if (contrast) { @@ -130,7 +132,7 @@ function createContrastPaletteBackgroundModel(background: BackgroundAutoBorderQu function createBorderBackgroundModel(background: BackgroundAutoBorderQualifier): IBorderBackgroundModel { return { ...createContrastPaletteBackgroundModel(background), - backgroundType: 'border' + backgroundType: "border", }; } @@ -138,9 +140,13 @@ function createBorderBackgroundModel(background: BackgroundAutoBorderQualifier): * Create an IBaseGradientBackgroundModel from given background * @param background */ -function createBaseGradientBackgroundModel(background: BackgroundBorderGradientQualifier): IBaseGradientBackgroundModel { +function createBaseGradientBackgroundModel( + background: BackgroundBorderGradientQualifier +): IBaseGradientBackgroundModel { const gradientColors = (background as unknown as { _gradientColors: number })._gradientColors; - const gradientDirection = `${(background as unknown as { _gradientDirection: GradientDirectionType })._gradientDirection}` as GradientDirectionType; + const gradientDirection = `${ + (background as unknown as { _gradientDirection: GradientDirectionType })._gradientDirection + }` as GradientDirectionType; const result = createContrastPaletteBackgroundModel(background) as unknown as IBorderGradientBackgroundModel; if (gradientColors) { @@ -158,10 +164,12 @@ function createBaseGradientBackgroundModel(background: BackgroundBorderGradientQ * Create an IBorderGradientBackgroundModel from given background * @param background */ -function createBorderGradientBackgroundModel(background: BackgroundBorderGradientQualifier): IBorderGradientBackgroundModel { +function createBorderGradientBackgroundModel( + background: BackgroundBorderGradientQualifier +): IBorderGradientBackgroundModel { return { ...createBaseGradientBackgroundModel(background), - backgroundType: 'borderGradient' + backgroundType: "borderGradient", } as IBorderGradientBackgroundModel; } @@ -171,8 +179,8 @@ function createBorderGradientBackgroundModel(background: BackgroundBorderGradien */ function createColorBackgroundModel(background: BackgroundColor): IColorBackgroundModel { return { - backgroundType: 'color', - color: getBackgroundValue(background) + backgroundType: "color", + color: getBackgroundValue(background), }; } @@ -183,7 +191,7 @@ function createColorBackgroundModel(background: BackgroundColor): IColorBackgrou function createPredominantBackgroundModel(background: BackgroundAutoPredominantQualifier): IPredominantBackgroundModel { return { ...createContrastPaletteBackgroundModel(background), - backgroundType: 'predominant' + backgroundType: "predominant", }; } @@ -191,10 +199,12 @@ function createPredominantBackgroundModel(background: BackgroundAutoPredominantQ * Create an IPredominantGradientBackgroundModel from given background * @param background */ -function createPredominantGradientBackgroundModel(background: BackgroundPredominantGradientQualifier): IPredominantGradientBackgroundModel { +function createPredominantGradientBackgroundModel( + background: BackgroundPredominantGradientQualifier +): IPredominantGradientBackgroundModel { return { ...createBaseGradientBackgroundModel(background), - backgroundType: 'predominantGradient' + backgroundType: "predominantGradient", }; } @@ -202,10 +212,12 @@ function createPredominantGradientBackgroundModel(background: BackgroundPredomin * Create an IGenerativeFillBackgroundModel from given background * @param urlValue */ -function createGenerativeFillBackgroundModel(background: BackgroundGenerativeFillQualifier): IGenerativeFillBackgroundModel { +function createGenerativeFillBackgroundModel( + background: BackgroundGenerativeFillQualifier +): IGenerativeFillBackgroundModel { return { backgroundType: background.getBackgroundType(), - ...(background.getPrompt() ? { prompt: background.getPrompt() } : {}) + ...(background.getPrompt() ? { prompt: background.getPrompt() } : {}), }; } @@ -214,7 +226,7 @@ function createGenerativeFillBackgroundModel(background: BackgroundGenerativeFil * @param background */ function createBackgroundModel(background: unknown): IBackgroundModel { - if (getBackgroundValue(background) === 'auto') { + if (getBackgroundValue(background) === "auto") { return createAutoBackgroundModel(); } @@ -255,5 +267,5 @@ export { IPredominantBackgroundModel, IPredominantGradientBackgroundModel, IGenerativeFillBackgroundModel, - createBackgroundModel + createBackgroundModel, }; diff --git a/src/internal/models/createGravityFromModel.ts b/src/internal/models/createGravityFromModel.ts index 000b809..b1bf712 100644 --- a/src/internal/models/createGravityFromModel.ts +++ b/src/internal/models/createGravityFromModel.ts @@ -1,25 +1,26 @@ import { IAutoGravityModel, IAutoGravityObjectModel, - ICompassGravityModel, IFocusOnGravityModel, + ICompassGravityModel, + IFocusOnGravityModel, IGravityModel, - IOcrGravityModel + IOcrGravityModel, } from "./createGravityModel.js"; -import {IGravity} from "../../qualifiers/gravity/GravityQualifier.js"; -import {autoGravity, focusOn} from "../../qualifiers/gravity.js"; -import {FocusOnValue, ocr} from "../../qualifiers/focusOn.js"; -import {AutoGravity} from "../../qualifiers/gravity/autoGravity/AutoGravity.js"; -import {AutoFocus} from "../../qualifiers/autoFocus.js"; -import {FocusOnGravity} from "../../qualifiers/gravity/focusOnGravity/FocusOnGravity.js"; -import {CompassGravity} from "../../qualifiers/gravity/compassGravity/CompassGravity.js"; -import {CompassQualifier} from "../../qualifiers/gravity/qualifiers/compass/CompassQualifier.js"; +import { IGravity } from "../../qualifiers/gravity/GravityQualifier.js"; +import { autoGravity, focusOn } from "../../qualifiers/gravity.js"; +import { FocusOnValue, ocr } from "../../qualifiers/focusOn.js"; +import { AutoGravity } from "../../qualifiers/gravity/autoGravity/AutoGravity.js"; +import { AutoFocus } from "../../qualifiers/autoFocus.js"; +import { FocusOnGravity } from "../../qualifiers/gravity/focusOnGravity/FocusOnGravity.js"; +import { CompassGravity } from "../../qualifiers/gravity/compassGravity/CompassGravity.js"; +import { CompassQualifier } from "../../qualifiers/gravity/qualifiers/compass/CompassQualifier.js"; /** * Validates that gravityModel is an ICompassGravityModel * @param gravityModel */ function isCompassGravityModel(gravityModel: IGravityModel): gravityModel is ICompassGravityModel { - return gravityModel.gravityType === 'direction'; + return gravityModel.gravityType === "direction"; } /** @@ -27,7 +28,7 @@ function isCompassGravityModel(gravityModel: IGravityModel): gravityModel is ICo * @param gravityModel */ function isOcrGravityModel(gravityModel: IGravityModel): gravityModel is IOcrGravityModel { - return gravityModel.gravityType === 'ocr'; + return gravityModel.gravityType === "ocr"; } /** @@ -35,7 +36,7 @@ function isOcrGravityModel(gravityModel: IGravityModel): gravityModel is IOcrGra * @param gravityModel */ function isAutoGravityModel(gravityModel: IGravityModel): gravityModel is IAutoGravityModel { - return gravityModel.gravityType === 'auto'; + return gravityModel.gravityType === "auto"; } /** @@ -43,7 +44,7 @@ function isAutoGravityModel(gravityModel: IGravityModel): gravityModel is IAutoG * @param autoGravityObjectModel */ function createAutoFocusFromModel(autoGravityObjectModel: IAutoGravityObjectModel): AutoFocus { - const {object, weight, avoid} = autoGravityObjectModel; + const { object, weight, avoid } = autoGravityObjectModel; const autoFocus = new AutoFocus(new FocusOnValue(object)); (weight || weight === 0) && autoFocus.weight(weight); avoid && autoFocus.avoid(); @@ -98,4 +99,4 @@ function createGravityFromModel(gravityModel: IGravityModel): IGravity { return createFocusOnGravityFromModel(gravityModel); } -export {createGravityFromModel}; +export { createGravityFromModel }; diff --git a/src/internal/models/createGravityModel.ts b/src/internal/models/createGravityModel.ts index 9a568a5..d2b74d2 100644 --- a/src/internal/models/createGravityModel.ts +++ b/src/internal/models/createGravityModel.ts @@ -1,12 +1,12 @@ -import {IGravity} from "../../qualifiers/gravity/GravityQualifier.js"; -import {CompassGravity, ICompassGravity} from "../../qualifiers/gravity/compassGravity/CompassGravity.js"; -import {AutoGravity} from "../../qualifiers/gravity/autoGravity/AutoGravity.js"; -import {AutoFocus} from "../../qualifiers/autoFocus.js"; -import {FocusOnGravity} from "../../qualifiers/gravity/focusOnGravity/FocusOnGravity.js"; -import {autoGravity} from "../../qualifiers/gravity.js"; -import {FocusOnValue} from "../../qualifiers/focusOn.js"; +import { IGravity } from "../../qualifiers/gravity/GravityQualifier.js"; +import { CompassGravity, ICompassGravity } from "../../qualifiers/gravity/compassGravity/CompassGravity.js"; +import { AutoGravity } from "../../qualifiers/gravity/autoGravity/AutoGravity.js"; +import { AutoFocus } from "../../qualifiers/autoFocus.js"; +import { FocusOnGravity } from "../../qualifiers/gravity/focusOnGravity/FocusOnGravity.js"; +import { autoGravity } from "../../qualifiers/gravity.js"; +import { FocusOnValue } from "../../qualifiers/focusOn.js"; -type IAutoGravityString = 'auto' | 'auto:'; +type IAutoGravityString = "auto" | "auto:"; export interface IGravityModel { gravityType: string; @@ -14,25 +14,24 @@ export interface IGravityModel { } export interface ICompassGravityModel extends IGravityModel { - compass: ICompassGravity + compass: ICompassGravity; } -export interface IOcrGravityModel extends IGravityModel { -} +export interface IOcrGravityModel extends IGravityModel {} export interface IAutoGravityObjectModel { - object: string, // 'cat' | 'dog' etc - weight?: number, - avoid?: boolean + object: string; // 'cat' | 'dog' etc + weight?: number; + avoid?: boolean; } export interface IAutoGravityModel extends IGravityModel { - autoFocus: IAutoGravityObjectModel[] + autoFocus: IAutoGravityObjectModel[]; } export interface IFocusOnGravityModel extends IGravityModel { - focusOnObjects: string[], // 'cat' | 'dog' etc - fallbackGravity?: IAutoGravityModel + focusOnObjects: string[]; // 'cat' | 'dog' etc + fallbackGravity?: IAutoGravityModel; } /** @@ -40,7 +39,7 @@ export interface IFocusOnGravityModel extends IGravityModel { * @param gravity */ function isIAutoGravityString(gravity: unknown): gravity is IAutoGravityString { - return gravity && `${gravity}`.split(':')[0] === 'auto'; + return gravity && `${gravity}`.split(":")[0] === "auto"; } /** @@ -50,7 +49,9 @@ function isIAutoGravityString(gravity: unknown): gravity is IAutoGravityString { function isCompassGravity(gravity: unknown): gravity is CompassGravity { //const gravityString = `${(typeof gravity === "string" ? gravity : gravity.qualifierValue)}`; const gravityValue = getGravityValue(gravity); - return ['north', 'center', 'east', 'west', 'south', 'north_west', 'south_east', 'south_west', 'north_east'].includes(gravityValue); + return ["north", "center", "east", "west", "south", "north_west", "south_east", "south_west", "north_east"].includes( + gravityValue + ); } /** @@ -58,7 +59,7 @@ function isCompassGravity(gravity: unknown): gravity is CompassGravity { * @param gravity */ function getGravityValue(gravity: unknown): string { - return `${gravity}`.replace('g_', ''); + return `${gravity}`.replace("g_", ""); } /** @@ -68,7 +69,7 @@ function getGravityValue(gravity: unknown): string { function createCompassGravityModel(gravity: CompassGravity): ICompassGravityModel { return { compass: getGravityValue(gravity) as ICompassGravity, - gravityType: 'direction' + gravityType: "direction", }; } @@ -77,7 +78,7 @@ function createCompassGravityModel(gravity: CompassGravity): ICompassGravityMode * @param gravity */ function isOcrGravity(gravity: unknown): boolean { - return getGravityValue(gravity) === 'ocr_text'; + return getGravityValue(gravity) === "ocr_text"; } /** @@ -85,7 +86,7 @@ function isOcrGravity(gravity: unknown): boolean { */ function createOcrGravityModel(): IOcrGravityModel { return { - gravityType: 'ocr' + gravityType: "ocr", }; } @@ -94,7 +95,7 @@ function createOcrGravityModel(): IOcrGravityModel { * @param gravity */ function isAutoGravity(gravity: unknown): gravity is AutoGravity { - return `${(gravity as AutoGravity).qualifierValue}`.split(':')[0] === 'auto'; + return `${(gravity as AutoGravity).qualifierValue}`.split(":")[0] === "auto"; } /** @@ -103,13 +104,13 @@ function isAutoGravity(gravity: unknown): gravity is AutoGravity { */ function createIAutoFocusObject(gravity: AutoFocus): IAutoGravityObjectModel { const gravityString = gravity.toString(); - const values = gravityString.split('_'); + const values = gravityString.split("_"); const result: IAutoGravityObjectModel = { - object: values[0] + object: values[0], }; if (values.length > 1) { - if (values[1] === 'avoid') { + if (values[1] === "avoid") { result.avoid = true; } else { result.weight = +values[1]; @@ -125,19 +126,19 @@ function createIAutoFocusObject(gravity: AutoFocus): IAutoGravityObjectModel { */ function createAutoGravityModel(gravity: IAutoGravityString | AutoGravity): IAutoGravityModel { let values; - const gravityQualifier = gravity === 'auto' ? new AutoGravity() : gravity as AutoGravity; + const gravityQualifier = gravity === "auto" ? new AutoGravity() : (gravity as AutoGravity); - if (`${gravity}`.startsWith('auto:')) { - values = `${gravity}`.split(':').filter((v) => v !== 'auto'); + if (`${gravity}`.startsWith("auto:")) { + values = `${gravity}`.split(":").filter((v) => v !== "auto"); } else { - values = gravityQualifier.qualifierValue.values.filter((v) => v !== 'auto'); + values = gravityQualifier.qualifierValue.values.filter((v) => v !== "auto"); } const autoFocus = values.map(createIAutoFocusObject); return { - gravityType: 'auto', - autoFocus + gravityType: "auto", + autoFocus, }; } @@ -146,13 +147,13 @@ function createAutoGravityModel(gravity: IAutoGravityString | AutoGravity): IAut * @param gravity */ function createFocusOnGravityModel(gravity: FocusOnGravity): IFocusOnGravityModel { - const hasAutoGravity = `${gravity}`.split(':').includes('auto'); + const hasAutoGravity = `${gravity}`.split(":").includes("auto"); const values = gravity.qualifierValue.values; const focusOnValues = hasAutoGravity ? values.slice(0, values.length - 1) : values; const result: IFocusOnGravityModel = { - gravityType: 'object', - focusOnObjects: focusOnValues.map((v) => `${v}`) + gravityType: "object", + focusOnObjects: focusOnValues.map((v) => `${v}`), }; if (hasAutoGravity) { @@ -170,7 +171,7 @@ function createFocusOnGravityModel(gravity: FocusOnGravity): IFocusOnGravityMode * @param gravity */ function createFocusOnGravity(gravity: string): FocusOnGravity { - const values = gravity.split(':'); + const values = gravity.split(":"); const focusOnValues = values.map((g) => new FocusOnValue(g)); return new FocusOnGravity(focusOnValues); } @@ -193,6 +194,6 @@ export function createGravityModel(gravity: IGravity): IGravityModel { } return createFocusOnGravityModel( - typeof gravity === 'string' ? createFocusOnGravity(gravity) : gravity as FocusOnGravity + typeof gravity === "string" ? createFocusOnGravity(gravity) : (gravity as FocusOnGravity) ); } diff --git a/src/internal/models/createPositionFromModel.ts b/src/internal/models/createPositionFromModel.ts index c450f51..dff5b8d 100644 --- a/src/internal/models/createPositionFromModel.ts +++ b/src/internal/models/createPositionFromModel.ts @@ -1,33 +1,33 @@ -import {IPositionModel} from "./IPositionModel.js"; -import {Position} from "../../qualifiers/position.js"; -import {createGravityFromModel} from "./createGravityFromModel.js"; -import {CompassGravity} from "../../qualifiers/gravity/compassGravity/CompassGravity.js"; +import { IPositionModel } from "./IPositionModel.js"; +import { Position } from "../../qualifiers/position.js"; +import { createGravityFromModel } from "./createGravityFromModel.js"; +import { CompassGravity } from "../../qualifiers/gravity/compassGravity/CompassGravity.js"; /** * Create Position from given IPositionModel * @param position */ export function createPositionFromModel(position: IPositionModel): Position { - const {offsetX, offsetY, tiled, allowOverflow, gravity} = position; + const { offsetX, offsetY, tiled, allowOverflow, gravity } = position; const result = new Position(); - if (offsetX){ + if (offsetX) { result.offsetX(offsetX); } - if (offsetY){ + if (offsetY) { result.offsetY(offsetY); } - if (tiled){ + if (tiled) { result.tiled(); } - if (allowOverflow != null){ + if (allowOverflow != null) { result.allowOverflow(allowOverflow); } - if (gravity){ + if (gravity) { result.gravity(createGravityFromModel(gravity) as CompassGravity); } diff --git a/src/internal/models/createSourceFromModel.ts b/src/internal/models/createSourceFromModel.ts index c7be187..7658dc6 100644 --- a/src/internal/models/createSourceFromModel.ts +++ b/src/internal/models/createSourceFromModel.ts @@ -1,26 +1,29 @@ -import {ITransformationFromJson} from "./IHasFromJson.js"; -import {isIImageSourceModel} from "./IImageSourceModel.js"; -import {ImageSource} from "../../qualifiers/source/sourceTypes/ImageSource.js"; -import {isIFetchSourceModel} from "./IFetchSourceModel.js"; -import {FetchSource} from "../../qualifiers/source/sourceTypes/FetchSource.js"; -import {VideoSource} from "../../qualifiers/source/sourceTypes/VideoSource.js"; -import {IVideoSourceModel} from "./IVideoSourceModel.js"; -import {ISourceModel} from "./ISourceModel.js"; -import {BaseSource} from "../../qualifiers/source/BaseSource.js"; -import {isITextSourceModel} from "./ITextSourceModel.js"; -import {TextSource} from "../../qualifiers/source/sourceTypes/TextSource.js"; +import { ITransformationFromJson } from "./IHasFromJson.js"; +import { isIImageSourceModel } from "./IImageSourceModel.js"; +import { ImageSource } from "../../qualifiers/source/sourceTypes/ImageSource.js"; +import { isIFetchSourceModel } from "./IFetchSourceModel.js"; +import { FetchSource } from "../../qualifiers/source/sourceTypes/FetchSource.js"; +import { VideoSource } from "../../qualifiers/source/sourceTypes/VideoSource.js"; +import { IVideoSourceModel } from "./IVideoSourceModel.js"; +import { ISourceModel } from "./ISourceModel.js"; +import { BaseSource } from "../../qualifiers/source/BaseSource.js"; +import { isITextSourceModel } from "./ITextSourceModel.js"; +import { TextSource } from "../../qualifiers/source/sourceTypes/TextSource.js"; /** * Create Source from given model json * @param source * @param transformationFromJson */ -export function createSourceFromModel (source: ISourceModel, transformationFromJson: ITransformationFromJson): BaseSource { - if (isITextSourceModel(source)){ +export function createSourceFromModel( + source: ISourceModel, + transformationFromJson: ITransformationFromJson +): BaseSource { + if (isITextSourceModel(source)) { return TextSource.fromJson(source, transformationFromJson); - } else if (isIImageSourceModel(source)){ + } else if (isIImageSourceModel(source)) { return ImageSource.fromJson(source, transformationFromJson); - } else if (isIFetchSourceModel(source)){ + } else if (isIFetchSourceModel(source)) { return FetchSource.fromJson(source, transformationFromJson); } else { return VideoSource.fromJson(source as IVideoSourceModel, transformationFromJson); diff --git a/src/internal/models/createTextStyleFromModel.ts b/src/internal/models/createTextStyleFromModel.ts index 835bc3b..96ed813 100644 --- a/src/internal/models/createTextStyleFromModel.ts +++ b/src/internal/models/createTextStyleFromModel.ts @@ -1,12 +1,12 @@ -import {ITextStyleModel} from "./ITextStyleModel.js"; -import {TextStyle} from "../../qualifiers/textStyle.js"; -import {solid} from "../../qualifiers/textStroke.js"; +import { ITextStyleModel } from "./ITextStyleModel.js"; +import { TextStyle } from "../../qualifiers/textStyle.js"; +import { solid } from "../../qualifiers/textStroke.js"; /** * Create TextStyle from ITextStyleModel * @param textStyleModel */ -export function createTextStyleFromModel(textStyleModel: ITextStyleModel): TextStyle{ +export function createTextStyleFromModel(textStyleModel: ITextStyleModel): TextStyle { const { fontFamily, fontSize, @@ -22,42 +22,42 @@ export function createTextStyleFromModel(textStyleModel: ITextStyleModel): TextS } = textStyleModel; const result = new TextStyle(fontFamily, fontSize); - if (fontWeight){ + if (fontWeight) { result.fontWeight(fontWeight); } - if (fontStyle){ + if (fontStyle) { result.fontStyle(fontStyle); } - if(fontAntialias){ + if (fontAntialias) { result.fontAntialias(fontAntialias); } - if (fontHinting){ + if (fontHinting) { result.fontHinting(fontHinting); } - if (textDecoration){ + if (textDecoration) { result.textDecoration(textDecoration); } - if(textAlignment){ + if (textAlignment) { result.textAlignment(textAlignment); } if (stroke) { result.stroke(); - if(typeof stroke !== "boolean" ) { + if (typeof stroke !== "boolean") { result.stroke(solid(stroke.width, stroke.color)); } } - if(letterSpacing){ + if (letterSpacing) { result.letterSpacing(letterSpacing); } - if(lineSpacing){ + if (lineSpacing) { result.lineSpacing(lineSpacing); } diff --git a/src/internal/models/createTimelinePositionFromModel.ts b/src/internal/models/createTimelinePositionFromModel.ts index 3fa57da..7594594 100644 --- a/src/internal/models/createTimelinePositionFromModel.ts +++ b/src/internal/models/createTimelinePositionFromModel.ts @@ -1,23 +1,23 @@ -import {ITimelinePositionModel} from "./ITimelinePositionModel.js"; -import {TimelinePosition} from "../../qualifiers/video/TimelinePosition.js"; +import { ITimelinePositionModel } from "./ITimelinePositionModel.js"; +import { TimelinePosition } from "../../qualifiers/video/TimelinePosition.js"; /** * Create TimelinePosition from given ITimelinePositionModel * @param timelinePosition */ export function createTimelinePositionFromModel(timelinePosition: ITimelinePositionModel): TimelinePosition { - const {startOffset, endOffset, duration} = timelinePosition; + const { startOffset, endOffset, duration } = timelinePosition; const result = new TimelinePosition(); - if (startOffset){ + if (startOffset) { result.startOffset(startOffset); } - if (endOffset){ + if (endOffset) { result.endOffset(endOffset); } - if (duration){ + if (duration) { result.duration(duration); } diff --git a/src/internal/models/qualifierToJson.ts b/src/internal/models/qualifierToJson.ts index 5fc0b06..d299014 100644 --- a/src/internal/models/qualifierToJson.ts +++ b/src/internal/models/qualifierToJson.ts @@ -1,6 +1,6 @@ -import {IErrorObject} from "./IErrorObject.js"; -import {createUnsupportedError} from "../utils/unsupportedError.js"; -import {IQualifierModel} from "./IQualifierModel.js"; +import { IErrorObject } from "./IErrorObject.js"; +import { createUnsupportedError } from "../utils/unsupportedError.js"; +import { IQualifierModel } from "./IQualifierModel.js"; export type IQualifierToJson = IQualifierModel | IErrorObject; @@ -8,5 +8,9 @@ export type IQualifierToJson = IQualifierModel | IErrorObject; * Returns the action's model */ export function qualifierToJson(): IQualifierToJson { - return this._qualifierModel || {error: createUnsupportedError(`unsupported qualifier ${this.constructor.name}`)}; + return ( + this._qualifierModel || { + error: createUnsupportedError(`unsupported qualifier ${this.constructor.name}`), + } + ); } diff --git a/src/internal/qualifier/Qualifier.ts b/src/internal/qualifier/Qualifier.ts index d99d270..9550ab5 100644 --- a/src/internal/qualifier/Qualifier.ts +++ b/src/internal/qualifier/Qualifier.ts @@ -1,14 +1,14 @@ -import {QualifierValue} from './QualifierValue.js'; -import {QualifierModel} from '../models/QualifierModel.js'; +import { QualifierValue } from "./QualifierValue.js"; +import { QualifierModel } from "../models/QualifierModel.js"; /** * @summary SDK * @memberOf SDK */ -class Qualifier extends QualifierModel{ +class Qualifier extends QualifierModel { key: string; qualifierValue: QualifierValue; - delimiter = '_'; // {key}{delimiter}{qualifierValue} + delimiter = "_"; // {key}{delimiter}{qualifierValue} constructor(key: string, qualifierValue?: QualifierValue | QualifierValue[] | number | string | (string | number)[]) { super(); @@ -22,7 +22,7 @@ class Qualifier extends QualifierModel{ } toString(): string { - const {key, delimiter, qualifierValue} = this; + const { key, delimiter, qualifierValue } = this; return `${key}${delimiter}${qualifierValue.toString()}`; } @@ -34,4 +34,4 @@ class Qualifier extends QualifierModel{ } } -export {Qualifier}; +export { Qualifier }; diff --git a/src/internal/qualifier/QualifierValue.ts b/src/internal/qualifier/QualifierValue.ts index aecf2e5..50d922c 100644 --- a/src/internal/qualifier/QualifierValue.ts +++ b/src/internal/qualifier/QualifierValue.ts @@ -1,4 +1,4 @@ -import {ExpressionQualifier} from "../../qualifiers/expression/ExpressionQualifier.js"; +import { ExpressionQualifier } from "../../qualifiers/expression/ExpressionQualifier.js"; /** * @summary SDK @@ -6,7 +6,7 @@ import {ExpressionQualifier} from "../../qualifiers/expression/ExpressionQualifi */ class QualifierValue { values: any[] = []; - delimiter = ':'; // {value}{delimiter}{value}... + delimiter = ":"; // {value}{delimiter}{value}... /** * @@ -32,7 +32,7 @@ class QualifierValue { * @return {boolean} */ private hasValue(v: any): boolean { - return typeof v !== 'undefined' && v !== null && v !== ''; + return typeof v !== "undefined" && v !== null && v !== ""; } /** @@ -64,4 +64,4 @@ class QualifierValue { } } -export {QualifierValue}; +export { QualifierValue }; diff --git a/src/internal/utils/base64Encode.ts b/src/internal/utils/base64Encode.ts index a1bead5..2d8903c 100644 --- a/src/internal/utils/base64Encode.ts +++ b/src/internal/utils/base64Encode.ts @@ -4,22 +4,22 @@ * @description An isomorphic Base64 function, provides browser and server support. * @param {string} input - A string to encode with base64 */ -function base64Encode(input: string):string { +function base64Encode(input: string): string { // Browser - let encodedResult = ''; + let encodedResult = ""; - if (typeof window !== 'undefined') { + if (typeof window !== "undefined") { // encodeURI the input to support unicode characters // Since the URI might be encoded already, we try to decode it once before encodedResult = btoa(encodeURI(decodeURI(input))); } else { // NodeJS support - encodedResult = global.Buffer.from(input).toString('base64'); + encodedResult = global.Buffer.from(input).toString("base64"); } return encodedResult - .replace(/\+/g, '-') // Convert '+' to '-' - .replace(/\//g, '_'); // Convert '/' to '_'; + .replace(/\+/g, "-") // Convert '+' to '-' + .replace(/\//g, "_"); // Convert '/' to '_'; } -export {base64Encode}; +export { base64Encode }; diff --git a/src/internal/utils/cloneDeep.ts b/src/internal/utils/cloneDeep.ts index a050fdc..bb150ab 100644 --- a/src/internal/utils/cloneDeep.ts +++ b/src/internal/utils/cloneDeep.ts @@ -16,40 +16,40 @@ var LARGE_ARRAY_SIZE = 200; /** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +var HASH_UNDEFINED = "__lodash_hash_undefined__"; /** Used as references for constious `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +var argsTag = "[object Arguments]", + arrayTag = "[object Array]", + boolTag = "[object Boolean]", + dateTag = "[object Date]", + errorTag = "[object Error]", + funcTag = "[object Function]", + genTag = "[object GeneratorFunction]", + mapTag = "[object Map]", + numberTag = "[object Number]", + objectTag = "[object Object]", + promiseTag = "[object Promise]", + regexpTag = "[object RegExp]", + setTag = "[object Set]", + stringTag = "[object String]", + symbolTag = "[object Symbol]", + weakMapTag = "[object WeakMap]"; + +var arrayBufferTag = "[object ArrayBuffer]", + dataViewTag = "[object DataView]", + float32Tag = "[object Float32Array]", + float64Tag = "[object Float64Array]", + int8Tag = "[object Int8Array]", + int16Tag = "[object Int16Array]", + int32Tag = "[object Int32Array]", + uint8Tag = "[object Uint8Array]", + uint8ClampedTag = "[object Uint8ClampedArray]", + uint16Tag = "[object Uint16Array]", + uint32Tag = "[object Uint32Array]"; /** * Used to match `RegExp` @@ -68,34 +68,45 @@ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; +cloneableTags[argsTag] = + cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = + cloneableTags[dataViewTag] = + cloneableTags[boolTag] = + cloneableTags[dateTag] = + cloneableTags[float32Tag] = + cloneableTags[float64Tag] = + cloneableTags[int8Tag] = + cloneableTags[int16Tag] = + cloneableTags[int32Tag] = + cloneableTags[mapTag] = + cloneableTags[numberTag] = + cloneableTags[objectTag] = + cloneableTags[regexpTag] = + cloneableTags[setTag] = + cloneableTags[stringTag] = + cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = + cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = + cloneableTags[uint32Tag] = + true; +cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** Detect free constiable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +var freeGlobal = typeof global == "object" && global && global.Object === Object && global; /** Detect free constiable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +var freeSelf = typeof self == "object" && self && self.Object === Object && self; /** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); +var root = freeGlobal || freeSelf || Function("return this")(); /** Detect free constiable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; +var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; /** Detect free constiable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; +var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; @@ -235,11 +246,10 @@ function isHostObject(value) { // Many host objects are `Object` objects that can coerce to strings // despite having improperly defined `toString` methods. var result = false; - if (value != null && typeof value.toString != 'function') { + if (value != null && typeof value.toString != "function") { try { - result = !!(`${value }`); - } catch (e) { - } + result = !!`${value}`; + } catch (e) {} } return result; } @@ -298,13 +308,13 @@ var arrayProto = Array.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; +var coreJsData = root["__core-js_shared__"]; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function () { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? (`Symbol(src)_1.${ uid}`) : ''; -}()); + var uid = /[^.]+$/.exec((coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO) || ""); + return uid ? `Symbol(src)_1.${uid}` : ""; +})(); /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; @@ -320,9 +330,11 @@ var hasOwnProperty = objectProto.hasOwnProperty; var objectToString = objectProto.toString; /** Used to detect if a method is native. */ -var reIsNative = RegExp(`^${ - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') }$` +var reIsNative = RegExp( + `^${funcToString + .call(hasOwnProperty) + .replace(reRegExpChar, "\\$&") + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?")}$` ); /** Built-in value references. */ @@ -340,12 +352,12 @@ var nativeGetSymbols = Object.getOwnPropertySymbols, nativeKeys = overArg(Object.keys, Object); /* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); +var DataView = getNative(root, "DataView"), + Map = getNative(root, "Map"), + Promise = getNative(root, "Promise"), + Set = getNative(root, "Set"), + WeakMap = getNative(root, "WeakMap"), + nativeCreate = getNative(Object, "create"); /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), @@ -445,7 +457,7 @@ function hashHas(key) { */ function hashSet(key, value) { var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; return this; } @@ -595,9 +607,9 @@ function MapCache(entries) { */ function mapCacheClear() { this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash + hash: new Hash(), + map: new (Map || ListCache)(), + string: new Hash(), }; } @@ -681,7 +693,7 @@ function Stack(entries) { * @memberOf Stack */ function stackClear() { - this.__data__ = new ListCache; + this.__data__ = new ListCache(); } /** @@ -737,7 +749,7 @@ function stackSet(key, value) { var cache = this.__data__; if (cache instanceof ListCache) { var pairs = cache.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) { pairs.push([key, value]); return this; } @@ -765,16 +777,13 @@ Stack.prototype.set = stackSet; function arrayLikeKeys(value, inherited) { // Safari 8.1 makes `arguments.callee` enumerable in strict mode. // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; + var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; var length = result.length, skipIndexes = !!length; for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { result.push(key); } } @@ -793,8 +802,7 @@ function arrayLikeKeys(value, inherited) { */ function assignValue(object, key, value) { var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { object[key] = value; } } @@ -884,7 +892,7 @@ function baseClone(value, isDeep, isFull, customizer, key, object, stack) { } } // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); + stack || (stack = new Stack()); var stacked = stack.get(value); if (stacked) { return stacked; @@ -956,7 +964,7 @@ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } @@ -973,7 +981,7 @@ function baseKeys(object) { } var result = []; for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { + if (hasOwnProperty.call(object, key) && key != "constructor") { result.push(key); } } @@ -1034,7 +1042,7 @@ function cloneDataView(dataView, isDeep) { */ function cloneMap(map, isDeep, cloneFunc) { var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); + return arrayReduce(array, addMapEntry, new map.constructor()); } /** @@ -1061,7 +1069,7 @@ function cloneRegExp(regexp) { */ function cloneSet(set, isDeep, cloneFunc) { var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); + return arrayReduce(array, addSetEntry, new set.constructor()); } /** @@ -1126,9 +1134,7 @@ function copyObject(source, props, object, customizer) { while (++index < length) { var key = props[index]; - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; + var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; assignValue(object, key, newValue === undefined ? source[key] : newValue); } @@ -1168,9 +1174,7 @@ function getAllKeys(object) { */ function getMapData(map, key) { var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; } /** @@ -1206,11 +1210,13 @@ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11, // for data views in Edge < 14, and promises in Node.js. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || +if ( + (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map()) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { + (Set && getTag(new Set()) != setTag) || + (WeakMap && getTag(new WeakMap()) != weakMapTag) +) { getTag = function (value) { var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : undefined, @@ -1246,7 +1252,7 @@ function initCloneArray(array) { result = array.constructor(length); // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) { result.index = array.index; result.input = array.input; } @@ -1261,9 +1267,7 @@ function initCloneArray(array) { * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; + return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; } /** @@ -1331,9 +1335,9 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) { */ function isIndex(value, length) { length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); + return ( + !!length && (typeof value == "number" || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length + ); } /** @@ -1345,9 +1349,9 @@ function isIndex(value, length) { */ function isKeyable(value) { var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); + return type == "string" || type == "number" || type == "symbol" || type == "boolean" + ? value !== "__proto__" + : value === null; } /** @@ -1358,7 +1362,7 @@ function isKeyable(value) { * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); + return !!maskSrcKey && maskSrcKey in func; } /** @@ -1370,7 +1374,7 @@ function isMasked(func) { */ function isPrototype(value) { var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + proto = (typeof Ctor == "function" && Ctor.prototype) || objectProto; return value === proto; } @@ -1386,14 +1390,12 @@ function toSource(func) { if (func != null) { try { return funcToString.call(func); - } catch (e) { - } + } catch (e) {} try { - return (`${func }`); - } catch (e) { - } + return `${func}`; + } catch (e) {} } - return ''; + return ""; } /** @@ -1474,8 +1476,11 @@ function eq(value, other) { */ function isArguments(value) { // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + return ( + isArrayLikeObject(value) && + hasOwnProperty.call(value, "callee") && + (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag) + ); } /** @@ -1600,7 +1605,7 @@ var isBuffer = nativeIsBuffer || stubFalse; function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; + var tag = isObject(value) ? objectToString.call(value) : ""; return tag == funcTag || tag == genTag; } @@ -1631,8 +1636,7 @@ function isFunction(value) { * // => false */ function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** @@ -1662,7 +1666,7 @@ function isLength(value) { */ function isObject(value) { var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + return !!value && (type == "object" || type == "function"); } /** @@ -1690,7 +1694,7 @@ function isObject(value) { * // => false */ function isObjectLike(value) { - return !!value && typeof value == 'object'; + return !!value && typeof value == "object"; } /** @@ -1764,4 +1768,4 @@ function stubFalse() { return false; } -export {cloneDeep}; +export { cloneDeep }; diff --git a/src/internal/utils/dataStructureUtils.ts b/src/internal/utils/dataStructureUtils.ts index 65886ae..cc1097a 100644 --- a/src/internal/utils/dataStructureUtils.ts +++ b/src/internal/utils/dataStructureUtils.ts @@ -1,4 +1,4 @@ -import {FlagQualifier} from "../../qualifiers/flag/FlagQualifier.js"; +import { FlagQualifier } from "../../qualifiers/flag/FlagQualifier.js"; /** * Sort a map by key @@ -14,7 +14,7 @@ function mapToSortedArray(map: Map, flags: FlagQua // Flags is an array of FlagQualifierObj // We need to convert it to the same form: [flagQualifier] => ['fl', flagQualifier] flags.forEach((flag) => { - array.push(['fl', flag]); // push ['fl', flagQualifier] + array.push(["fl", flag]); // push ['fl', flagQualifier] }); return array.sort().map((v) => v[1]); @@ -27,10 +27,7 @@ function mapToSortedArray(map: Map, flags: FlagQua * @return {boolean} `true` if `value` is a string, else `false`. */ function isString(value: any): value is string { - return (typeof value === 'string' || value instanceof String); + return typeof value === "string" || value instanceof String; } -export { - isString, - mapToSortedArray -}; +export { isString, mapToSortedArray }; diff --git a/src/internal/utils/jest-ts-resolver.cjs b/src/internal/utils/jest-ts-resolver.cjs index edb4cb3..27d1f56 100644 --- a/src/internal/utils/jest-ts-resolver.cjs +++ b/src/internal/utils/jest-ts-resolver.cjs @@ -4,12 +4,12 @@ */ module.exports = (request, options) => { // Jest's default resolver - const {defaultResolver} = options; + const { defaultResolver } = options; try { return defaultResolver(request, options); // if default resolver fails we replace file extension from .js to .ts } catch (e) { - return defaultResolver(request.replace(/\.js$/, '.ts'), options); + return defaultResolver(request.replace(/\.js$/, ".ts"), options); } }; diff --git a/src/internal/utils/objectFlip.ts b/src/internal/utils/objectFlip.ts index 58ed48f..5ac06d7 100644 --- a/src/internal/utils/objectFlip.ts +++ b/src/internal/utils/objectFlip.ts @@ -11,4 +11,4 @@ function objectFlip(obj: Record): Record { return result; } -export {objectFlip}; \ No newline at end of file +export { objectFlip }; diff --git a/src/internal/utils/packageVersion.ts b/src/internal/utils/packageVersion.ts index 469ee67..2532ac6 100644 --- a/src/internal/utils/packageVersion.ts +++ b/src/internal/utils/packageVersion.ts @@ -1,4 +1,4 @@ -const packageVersion = 'PACKAGE_VERSION_INJECTED_DURING_BUILD'; +const packageVersion = "PACKAGE_VERSION_INJECTED_DURING_BUILD"; /** * Export package version (injected during our build). @@ -6,6 +6,4 @@ const packageVersion = 'PACKAGE_VERSION_INJECTED_DURING_BUILD'; * it will cause an error for users who do not have an 'import from json' plugin * as part of their build process / bundler. */ -export { - packageVersion -}; \ No newline at end of file +export { packageVersion }; diff --git a/src/internal/utils/prepareColor.ts b/src/internal/utils/prepareColor.ts index 72f6931..f48ad59 100644 --- a/src/internal/utils/prepareColor.ts +++ b/src/internal/utils/prepareColor.ts @@ -1,5 +1,4 @@ -import {SystemColors} from "../../qualifiers/color.js"; - +import { SystemColors } from "../../qualifiers/color.js"; /** * Returns RGB or Color diff --git a/src/internal/utils/serializeCloudinaryCharacters.ts b/src/internal/utils/serializeCloudinaryCharacters.ts index 121c29b..03415de 100644 --- a/src/internal/utils/serializeCloudinaryCharacters.ts +++ b/src/internal/utils/serializeCloudinaryCharacters.ts @@ -4,12 +4,8 @@ * @param {string} str * @private */ -function serializeCloudinaryCharacters(str = ''): string { - return str - .replace(/,/g, '%2C') - .replace(/\//g, '%2F'); +function serializeCloudinaryCharacters(str = ""): string { + return str.replace(/,/g, "%2C").replace(/\//g, "%2F"); } -export { - serializeCloudinaryCharacters -}; +export { serializeCloudinaryCharacters }; diff --git a/src/internal/utils/toFloatAsString.ts b/src/internal/utils/toFloatAsString.ts index 03a51ee..f519e3f 100644 --- a/src/internal/utils/toFloatAsString.ts +++ b/src/internal/utils/toFloatAsString.ts @@ -22,15 +22,15 @@ export function toFloatAsString(value: string | number): string { // If the leading digit is 0, and we have more than 1 digit, it's not a number. // 00, 00000, 0x15 etc. - if (returnValue.length > 1 && returnValue[0] === '0') { + if (returnValue.length > 1 && returnValue[0] === "0") { return returnValue; } // Final sanity check, parse the number as a float and check if its NaN - const isNumberLike = !isNaN(parseFloat(returnValue)) && returnValue.indexOf(':') === -1; + const isNumberLike = !isNaN(parseFloat(returnValue)) && returnValue.indexOf(":") === -1; // If it's a number-like, but the input does not contain a decimal - add it. - if (isNumberLike && returnValue.indexOf('.') === -1) { + if (isNumberLike && returnValue.indexOf(".") === -1) { return `${returnValue}.0`; } else { // If the input already contains a decimal, just return the value diff --git a/src/internal/utils/unsupportedError.ts b/src/internal/utils/unsupportedError.ts index 709c222..a363aba 100644 --- a/src/internal/utils/unsupportedError.ts +++ b/src/internal/utils/unsupportedError.ts @@ -1,5 +1,5 @@ class UnsupportedError extends Error { - constructor(message = 'Unsupported') { + constructor(message = "Unsupported") { super(message); } } @@ -8,7 +8,7 @@ class UnsupportedError extends Error { * Creates a new UnsupportedError * @param message */ -function createUnsupportedError(message: string): UnsupportedError{ +function createUnsupportedError(message: string): UnsupportedError { return new UnsupportedError(message); } export { UnsupportedError, createUnsupportedError }; diff --git a/src/qualifiers.ts b/src/qualifiers.ts index 0788cf9..15d4be5 100644 --- a/src/qualifiers.ts +++ b/src/qualifiers.ts @@ -1,31 +1,31 @@ -export {TextDecoration} from "./qualifiers/textDecoration.js"; -export {TextAlignment} from "./qualifiers/textAlignment.js"; -export {Stroke} from "./qualifiers/textStroke.js"; -export {StreamingProfile} from "./qualifiers/streamingProfile.js"; -export {SimulateColorBlind} from "./qualifiers/simulateColorBlind.js"; -export {RotationMode} from "./qualifiers/rotationMode.js"; -export {Region} from "./qualifiers/region.js"; -export {Quality} from "./qualifiers/quality.js"; -export {Position} from "./qualifiers/position.js"; -export {OutlineMode} from "./qualifiers/outlineMode.js"; -export {ImproveMode} from "./qualifiers/improveMode.js"; -export {GradientDirection} from "./qualifiers/gradientDirection.js"; -export {Format} from "./qualifiers/format.js"; -export {FontWeight} from "./qualifiers/fontWeight.js"; -export {FontStyle} from "./qualifiers/fontStyle.js"; -export {FontHinting} from "./qualifiers/fontHinting.js"; -export {Expression} from "./qualifiers/expression.js"; -export {Dither} from "./qualifiers/dither.js"; -export {ColorSpace} from "./qualifiers/colorSpace.js"; -export {Color} from "./qualifiers/color.js"; -export {Background} from "./qualifiers/background.js"; -export {AudioFrequency} from "./qualifiers/audioFrequency.js"; -export {AudioCodec} from "./qualifiers/audioCodec.js"; -export {AspectRatio} from "./qualifiers/aspectRatio.js"; -export {ArtisticFilter} from "./qualifiers/artisticFilter.js"; -export {AnimatedFormat} from "./qualifiers/animatedFormat.js"; -export {Gravity} from "./qualifiers/gravity.js"; -export {ChromaSubSampling} from "./qualifiers/chromaSubSampling.js"; -export {Dpr} from "./qualifiers/dpr.js"; -export {Source} from "./qualifiers/source.js"; -export {GradientFade} from "./qualifiers/GradientFade.js"; +export { TextDecoration } from "./qualifiers/textDecoration.js"; +export { TextAlignment } from "./qualifiers/textAlignment.js"; +export { Stroke } from "./qualifiers/textStroke.js"; +export { StreamingProfile } from "./qualifiers/streamingProfile.js"; +export { SimulateColorBlind } from "./qualifiers/simulateColorBlind.js"; +export { RotationMode } from "./qualifiers/rotationMode.js"; +export { Region } from "./qualifiers/region.js"; +export { Quality } from "./qualifiers/quality.js"; +export { Position } from "./qualifiers/position.js"; +export { OutlineMode } from "./qualifiers/outlineMode.js"; +export { ImproveMode } from "./qualifiers/improveMode.js"; +export { GradientDirection } from "./qualifiers/gradientDirection.js"; +export { Format } from "./qualifiers/format.js"; +export { FontWeight } from "./qualifiers/fontWeight.js"; +export { FontStyle } from "./qualifiers/fontStyle.js"; +export { FontHinting } from "./qualifiers/fontHinting.js"; +export { Expression } from "./qualifiers/expression.js"; +export { Dither } from "./qualifiers/dither.js"; +export { ColorSpace } from "./qualifiers/colorSpace.js"; +export { Color } from "./qualifiers/color.js"; +export { Background } from "./qualifiers/background.js"; +export { AudioFrequency } from "./qualifiers/audioFrequency.js"; +export { AudioCodec } from "./qualifiers/audioCodec.js"; +export { AspectRatio } from "./qualifiers/aspectRatio.js"; +export { ArtisticFilter } from "./qualifiers/artisticFilter.js"; +export { AnimatedFormat } from "./qualifiers/animatedFormat.js"; +export { Gravity } from "./qualifiers/gravity.js"; +export { ChromaSubSampling } from "./qualifiers/chromaSubSampling.js"; +export { Dpr } from "./qualifiers/dpr.js"; +export { Source } from "./qualifiers/source.js"; +export { GradientFade } from "./qualifiers/GradientFade.js"; diff --git a/src/qualifiers/FontAntialias.ts b/src/qualifiers/FontAntialias.ts index 3189573..0147e97 100644 --- a/src/qualifiers/FontAntialias.ts +++ b/src/qualifiers/FontAntialias.ts @@ -12,7 +12,7 @@ * @memberOf Qualifiers.FontAntialias */ function none(): string { - return ''; + return ""; } /** @@ -20,7 +20,7 @@ function none(): string { * @memberOf Qualifiers.FontAntialias */ function gray(): string { - return 'gray'; + return "gray"; } /** @@ -28,7 +28,7 @@ function gray(): string { * @memberOf Qualifiers.FontAntialias */ function subpixel(): string { - return 'subpixel'; + return "subpixel"; } /** @@ -36,7 +36,7 @@ function subpixel(): string { * @memberOf Qualifiers.FontAntialias */ function fast(): string { - return 'fast'; + return "fast"; } /** @@ -44,7 +44,7 @@ function fast(): string { * @memberOf Qualifiers.FontAntialias */ function good(): string { - return 'good'; + return "good"; } /** @@ -52,17 +52,9 @@ function good(): string { * @memberOf Qualifiers.FontAntialias */ function best(): string { - return 'best'; + return "best"; } -const FontAntialias = {gray, subpixel, best, fast, none, good}; +const FontAntialias = { gray, subpixel, best, fast, none, good }; -export { - FontAntialias, - gray, - subpixel, - best, - fast, - none, - good -}; +export { FontAntialias, gray, subpixel, best, fast, none, good }; diff --git a/src/qualifiers/GradientFade.ts b/src/qualifiers/GradientFade.ts index 509c843..29bc34c 100644 --- a/src/qualifiers/GradientFade.ts +++ b/src/qualifiers/GradientFade.ts @@ -11,7 +11,7 @@ * @return {string} */ function symmetric(): string { - return 'symmetric'; + return "symmetric"; } /** @@ -21,17 +21,12 @@ function symmetric(): string { * @return {string} */ function symmetricPad(): string { - return 'symmetric_pad'; + return "symmetric_pad"; } - const GradientFade = { symmetric, - symmetricPad -}; - -export { - GradientFade, symmetricPad, - symmetric }; + +export { GradientFade, symmetricPad, symmetric }; diff --git a/src/qualifiers/animatedFormat.ts b/src/qualifiers/animatedFormat.ts index c45f816..f17c435 100644 --- a/src/qualifiers/animatedFormat.ts +++ b/src/qualifiers/animatedFormat.ts @@ -1,4 +1,4 @@ -import {AnimatedFormatQualifierValue} from "./animatedFormat/AnimatedFormatQualifierValue.js"; +import { AnimatedFormatQualifierValue } from "./animatedFormat/AnimatedFormatQualifierValue.js"; /** * @description Contains methods to specify the animated format @@ -7,7 +7,6 @@ import {AnimatedFormatQualifierValue} from "./animatedFormat/AnimatedFormatQuali * @see Visit {@link Actions.Transcode|Transcode} for an example */ - /** * @description Automatically sets the animated format * @summary qualifier @@ -15,17 +14,16 @@ import {AnimatedFormatQualifierValue} from "./animatedFormat/AnimatedFormatQuali * @return {Qualifiers.AnimatedFormatQualifierValue} */ function auto(): AnimatedFormatQualifierValue { - return new AnimatedFormatQualifierValue('auto'); + return new AnimatedFormatQualifierValue("auto"); } - /** * @summary qualifier * @memberOf Qualifiers.AnimatedFormat * @return {Qualifiers.AnimatedFormatQualifierValue} */ function gif(): AnimatedFormatQualifierValue { - return new AnimatedFormatQualifierValue('gif'); + return new AnimatedFormatQualifierValue("gif"); } /** @@ -34,7 +32,7 @@ function gif(): AnimatedFormatQualifierValue { * @return {Qualifiers.AnimatedFormatQualifierValue} */ function webp(): AnimatedFormatQualifierValue { - return new AnimatedFormatQualifierValue('webp'); + return new AnimatedFormatQualifierValue("webp"); } /** @@ -43,11 +41,8 @@ function webp(): AnimatedFormatQualifierValue { * @return {Qualifiers.AnimatedFormatQualifierValue} */ function png(): AnimatedFormatQualifierValue { - return new AnimatedFormatQualifierValue('png'); + return new AnimatedFormatQualifierValue("png"); } - -const AnimatedFormat = {auto, gif, webp, png}; -export {auto, gif, webp, png, AnimatedFormat}; - - +const AnimatedFormat = { auto, gif, webp, png }; +export { auto, gif, webp, png, AnimatedFormat }; diff --git a/src/qualifiers/animatedFormat/AnimatedFormatQualifierValue.ts b/src/qualifiers/animatedFormat/AnimatedFormatQualifierValue.ts index 7003655..a802608 100644 --- a/src/qualifiers/animatedFormat/AnimatedFormatQualifierValue.ts +++ b/src/qualifiers/animatedFormat/AnimatedFormatQualifierValue.ts @@ -1,12 +1,9 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @memberOf Qualifiers.AnimatedFormat * @extends {SDK.QualifierValue} */ -class AnimatedFormatQualifierValue extends QualifierValue { +class AnimatedFormatQualifierValue extends QualifierValue {} -} - - -export {AnimatedFormatQualifierValue}; +export { AnimatedFormatQualifierValue }; diff --git a/src/qualifiers/artisticFilter.ts b/src/qualifiers/artisticFilter.ts index e53d8ea..2133910 100644 --- a/src/qualifiers/artisticFilter.ts +++ b/src/qualifiers/artisticFilter.ts @@ -6,13 +6,12 @@ * @see Visit {@link Actions.Effect|Effect} for an example */ - /** * @summary qualifier * @memberOf Qualifiers.ArtisticFilter */ function alDente(): string { - return 'al_dente'; + return "al_dente"; } /** @@ -20,7 +19,7 @@ function alDente(): string { * @memberOf Qualifiers.ArtisticFilter */ function athena(): string { - return 'athena'; + return "athena"; } /** @@ -28,7 +27,7 @@ function athena(): string { * @memberOf Qualifiers.ArtisticFilter */ function audrey(): string { - return 'audrey'; + return "audrey"; } /** @@ -36,7 +35,7 @@ function audrey(): string { * @memberOf Qualifiers.ArtisticFilter */ function aurora(): string { - return 'aurora'; + return "aurora"; } /** @@ -44,7 +43,7 @@ function aurora(): string { * @memberOf Qualifiers.ArtisticFilter */ function daguerre(): string { - return 'daguerre'; + return "daguerre"; } /** @@ -52,7 +51,7 @@ function daguerre(): string { * @memberOf Qualifiers.ArtisticFilter */ function eucalyptus(): string { - return 'eucalyptus'; + return "eucalyptus"; } /** @@ -60,7 +59,7 @@ function eucalyptus(): string { * @memberOf Qualifiers.ArtisticFilter */ function fes(): string { - return 'fes'; + return "fes"; } /** @@ -68,7 +67,7 @@ function fes(): string { * @memberOf Qualifiers.ArtisticFilter */ function frost(): string { - return 'frost'; + return "frost"; } /** @@ -76,7 +75,7 @@ function frost(): string { * @memberOf Qualifiers.ArtisticFilter */ function hairspray(): string { - return 'hairspray'; + return "hairspray"; } /** @@ -84,7 +83,7 @@ function hairspray(): string { * @memberOf Qualifiers.ArtisticFilter */ function hokusai(): string { - return 'hokusai'; + return "hokusai"; } /** @@ -92,7 +91,7 @@ function hokusai(): string { * @memberOf Qualifiers.ArtisticFilter */ function incognito(): string { - return 'incognito'; + return "incognito"; } /** @@ -100,7 +99,7 @@ function incognito(): string { * @memberOf Qualifiers.ArtisticFilter */ function linen(): string { - return 'linen'; + return "linen"; } /** @@ -108,7 +107,7 @@ function linen(): string { * @memberOf Qualifiers.ArtisticFilter */ function peacock(): string { - return 'peacock'; + return "peacock"; } /** @@ -116,7 +115,7 @@ function peacock(): string { * @memberOf Qualifiers.ArtisticFilter */ function primavera(): string { - return 'primavera'; + return "primavera"; } /** @@ -124,7 +123,7 @@ function primavera(): string { * @memberOf Qualifiers.ArtisticFilter */ function quartz(): string { - return 'quartz'; + return "quartz"; } /** @@ -132,7 +131,7 @@ function quartz(): string { * @memberOf Qualifiers.ArtisticFilter */ function redRock(): string { - return 'red_rock'; + return "red_rock"; } /** @@ -140,7 +139,7 @@ function redRock(): string { * @memberOf Qualifiers.ArtisticFilter */ function refresh(): string { - return 'refresh'; + return "refresh"; } /** @@ -148,7 +147,7 @@ function refresh(): string { * @memberOf Qualifiers.ArtisticFilter */ function sizzle(): string { - return 'sizzle'; + return "sizzle"; } /** @@ -156,7 +155,7 @@ function sizzle(): string { * @memberOf Qualifiers.ArtisticFilter */ function sonnet(): string { - return 'sonnet'; + return "sonnet"; } /** @@ -164,7 +163,7 @@ function sonnet(): string { * @memberOf Qualifiers.ArtisticFilter */ function ukulele(): string { - return 'ukulele'; + return "ukulele"; } /** @@ -172,7 +171,7 @@ function ukulele(): string { * @memberOf Qualifiers.ArtisticFilter */ function zorro(): string { - return 'zorro'; + return "zorro"; } const ArtisticFilter = { @@ -196,10 +195,9 @@ const ArtisticFilter = { sonnet, ukulele, frost, - zorro + zorro, }; - export { ArtisticFilter, alDente, @@ -222,7 +220,5 @@ export { sonnet, ukulele, frost, - zorro + zorro, }; - - diff --git a/src/qualifiers/aspectRatio.ts b/src/qualifiers/aspectRatio.ts index 619fb04..2dc3230 100644 --- a/src/qualifiers/aspectRatio.ts +++ b/src/qualifiers/aspectRatio.ts @@ -1,7 +1,6 @@ -import {AspectRatioQualifierValue} from "./aspectRatio/AspectRatioQualifierValue.js"; -import {ignoreInitialAspectRatio as ignoreInitialAspectRatioFlag} from "./flag.js"; -import {FlagQualifier} from "./flag/FlagQualifier.js"; - +import { AspectRatioQualifierValue } from "./aspectRatio/AspectRatioQualifierValue.js"; +import { ignoreInitialAspectRatio as ignoreInitialAspectRatioFlag } from "./flag.js"; +import { FlagQualifier } from "./flag/FlagQualifier.js"; /** * @description 1 by 1 aspect ration. @@ -9,7 +8,7 @@ import {FlagQualifier} from "./flag/FlagQualifier.js"; * @return {string} */ function ar1X1(): AspectRatioQualifierValue { - return new AspectRatioQualifierValue('1:1'); + return new AspectRatioQualifierValue("1:1"); } /** @@ -19,7 +18,7 @@ function ar1X1(): AspectRatioQualifierValue { * @return {string} */ function ar5X4(): AspectRatioQualifierValue { - return new AspectRatioQualifierValue('5:4'); + return new AspectRatioQualifierValue("5:4"); } /** @@ -29,7 +28,7 @@ function ar5X4(): AspectRatioQualifierValue { * @return {string} */ function ar4X3(): AspectRatioQualifierValue { - return new AspectRatioQualifierValue('4:3'); + return new AspectRatioQualifierValue("4:3"); } /** @@ -39,7 +38,7 @@ function ar4X3(): AspectRatioQualifierValue { * @return {string} */ function ar3X2(): AspectRatioQualifierValue { - return new AspectRatioQualifierValue('3:2'); + return new AspectRatioQualifierValue("3:2"); } /** @@ -49,7 +48,7 @@ function ar3X2(): AspectRatioQualifierValue { * @return {string} */ function ar16X9(): AspectRatioQualifierValue { - return new AspectRatioQualifierValue('16:9'); + return new AspectRatioQualifierValue("16:9"); } /** @@ -59,7 +58,7 @@ function ar16X9(): AspectRatioQualifierValue { * @return {string} */ function ar3X1(): AspectRatioQualifierValue { - return new AspectRatioQualifierValue('3:1'); + return new AspectRatioQualifierValue("3:1"); } /** @@ -72,7 +71,6 @@ function ignoreInitialAspectRatio(): FlagQualifier { return ignoreInitialAspectRatioFlag(); } - /** * @summary qualifier * @description A list of all most commonly used aspect ratios. including an ‘ignore aspect ratio’ option which direct the BE to not stick to the original aspect ratio. @@ -88,8 +86,7 @@ const AspectRatio = { ar3X2, ar4X3, ar16X9, - ignoreInitialAspectRatio + ignoreInitialAspectRatio, }; - -export {ar1X1, ar5X4, ar3X1, ar3X2, ar4X3, ar16X9, ignoreInitialAspectRatio, AspectRatio}; +export { ar1X1, ar5X4, ar3X1, ar3X2, ar4X3, ar16X9, ignoreInitialAspectRatio, AspectRatio }; diff --git a/src/qualifiers/aspectRatio/AspectRatioQualifierValue.ts b/src/qualifiers/aspectRatio/AspectRatioQualifierValue.ts index 6ffc141..5936b91 100644 --- a/src/qualifiers/aspectRatio/AspectRatioQualifierValue.ts +++ b/src/qualifiers/aspectRatio/AspectRatioQualifierValue.ts @@ -1,4 +1,4 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @memberOf Qualifiers.AspectRatio diff --git a/src/qualifiers/audioCodec.ts b/src/qualifiers/audioCodec.ts index 0981bf0..92f80c8 100644 --- a/src/qualifiers/audioCodec.ts +++ b/src/qualifiers/audioCodec.ts @@ -11,7 +11,7 @@ * @memberOf Qualifiers.AudioCodec */ function none(): string { - return 'none'; + return "none"; } /** @@ -19,7 +19,7 @@ function none(): string { * @memberOf Qualifiers.AudioCodec */ function aac(): string { - return 'aac'; + return "aac"; } /** @@ -27,7 +27,7 @@ function aac(): string { * @memberOf Qualifiers.AudioCodec */ function vorbis(): string { - return 'vorbis'; + return "vorbis"; } /** @@ -35,7 +35,7 @@ function vorbis(): string { * @memberOf Qualifiers.AudioCodec */ function mp3(): string { - return 'mp3'; + return "mp3"; } /** @@ -43,25 +43,15 @@ function mp3(): string { * @memberOf Qualifiers.AudioCodec */ function opus(): string { - return 'opus'; + return "opus"; } - const AudioCodec = { aac, mp3, opus, none, - vorbis -}; - -export { - AudioCodec, - aac, - mp3, - opus, - none, - vorbis + vorbis, }; - +export { AudioCodec, aac, mp3, opus, none, vorbis }; diff --git a/src/qualifiers/audioFrequency.ts b/src/qualifiers/audioFrequency.ts index 88233df..9f4e241 100644 --- a/src/qualifiers/audioFrequency.ts +++ b/src/qualifiers/audioFrequency.ts @@ -5,14 +5,13 @@ * @see Visit {@link Actions.Transcode|Transcode} for an example */ - /** * @summary qualifier * @description Preserves the original audio frequency of the video when used with vc_auto. * @memberOf Qualifiers.AudioFrequency */ function ORIGINAL(): string { - return 'iaf'; + return "iaf"; } /** @@ -31,7 +30,6 @@ function FREQ176400(): number { return 176400; } - /** * @summary qualifier * @memberOf Qualifiers.AudioFrequency @@ -40,7 +38,6 @@ function FREQ96000(): number { return 96000; } - /** * @summary qualifier * @memberOf Qualifiers.AudioFrequency @@ -49,7 +46,6 @@ function FREQ88200(): number { return 88200; } - /** * @summary qualifier * @memberOf Qualifiers.AudioFrequency @@ -130,8 +126,6 @@ function FREQ47250(): number { return 47250; } - - const AudioFrequency = { FREQ8000, FREQ11025, @@ -147,7 +141,7 @@ const AudioFrequency = { FREQ96000, FREQ176400, FREQ192000, - ORIGINAL + ORIGINAL, }; export { @@ -166,5 +160,5 @@ export { FREQ96000, FREQ176400, FREQ192000, - ORIGINAL + ORIGINAL, }; diff --git a/src/qualifiers/autoFocus.ts b/src/qualifiers/autoFocus.ts index 9902596..69ebbcc 100644 --- a/src/qualifiers/autoFocus.ts +++ b/src/qualifiers/autoFocus.ts @@ -1,5 +1,5 @@ -import {QualifierValue} from "../internal/qualifier/QualifierValue.js"; -import {FocusOnValue} from "./focusOn.js"; +import { QualifierValue } from "../internal/qualifier/QualifierValue.js"; +import { FocusOnValue } from "./focusOn.js"; /** * @summary qualifier @@ -8,7 +8,6 @@ import {FocusOnValue} from "./focusOn.js"; * @see Visit {@link Qualifiers.Gravity|Gravity} for an example */ - /** * @memberOf Qualifiers.AutoFocus * @extends {SDK.QualifierValue} @@ -38,7 +37,7 @@ class AutoFocus extends QualifierValue { } private shouldAddWeight() { - return typeof this._weight === 'number' || typeof this._weight === 'string' || this.shouldAvoid; + return typeof this._weight === "number" || typeof this._weight === "string" || this.shouldAvoid; } /** @@ -55,7 +54,7 @@ class AutoFocus extends QualifierValue { */ private getWeight(): number | string { if (this.shouldAvoid) { - return 'avoid'; + return "avoid"; } else { return this._weight; } @@ -98,4 +97,4 @@ class AutoFocus extends QualifierValue { const focusOn = AutoFocus.focusOn; -export {AutoFocus, focusOn}; +export { AutoFocus, focusOn }; diff --git a/src/qualifiers/background.ts b/src/qualifiers/background.ts index 684e716..edb2b95 100644 --- a/src/qualifiers/background.ts +++ b/src/qualifiers/background.ts @@ -1,13 +1,11 @@ -import {prepareColor} from "../internal/utils/prepareColor.js"; -import {BackgroundAutoBorderQualifier} from "./background/shared/auto/BackgroundAutoBorderQualifier.js"; -import {BackgroundBorderGradientQualifier} from "./background/shared/gradient/BackgroundBorderGradientQualifier.js"; -import {BackgroundAutoPredominantQualifier} from "./background/shared/auto/BackgroundAutoPredominantQualifier.js"; -import {BackgroundPredominantGradientQualifier} from "./background/shared/gradient/BackgroundPredominantGradientQualifier.js"; +import { prepareColor } from "../internal/utils/prepareColor.js"; +import { BackgroundAutoBorderQualifier } from "./background/shared/auto/BackgroundAutoBorderQualifier.js"; +import { BackgroundBorderGradientQualifier } from "./background/shared/gradient/BackgroundBorderGradientQualifier.js"; +import { BackgroundAutoPredominantQualifier } from "./background/shared/auto/BackgroundAutoPredominantQualifier.js"; +import { BackgroundPredominantGradientQualifier } from "./background/shared/gradient/BackgroundPredominantGradientQualifier.js"; import BlurredBackgroundAction from "./background/shared/BlurredBackgroundAction.js"; -import {BackgroundQualifier} from "./background/shared/base/BackgroundQualifier.js"; -import {SystemColors} from "./color.js"; - - +import { BackgroundQualifier } from "./background/shared/base/BackgroundQualifier.js"; +import { SystemColors } from "./color.js"; /** * @description Defines the background color to use instead of transparent background areas or when resizing with padding. @@ -18,15 +16,13 @@ import {SystemColors} from "./color.js"; * @memberOf Qualifiers */ - - /** * @summary qualifier * @description Selects the predominant color while taking only the image border pixels into account. * @memberOf Qualifiers.Background * @return {BackgroundAutoBorderQualifier} */ -function border(): BackgroundAutoBorderQualifier{ +function border(): BackgroundAutoBorderQualifier { return new BackgroundAutoBorderQualifier(); } @@ -38,8 +34,8 @@ function border(): BackgroundAutoBorderQualifier{ * @memberOf Qualifiers.Background * @return {Qualifiers.Background.BackgroundQualifier} */ -function auto(): BackgroundQualifier{ - return new BackgroundQualifier('auto'); +function auto(): BackgroundQualifier { + return new BackgroundQualifier("auto"); } /** @@ -99,17 +95,7 @@ const Background = { predominantGradient: predominantGradient, predominant: predominant, color: color, - blurred: blurred -}; - -export { - auto, - border, - borderGradient, - predominantGradient, - predominant, - color, - blurred, - Background + blurred: blurred, }; +export { auto, border, borderGradient, predominantGradient, predominant, color, blurred, Background }; diff --git a/src/qualifiers/background/shared/BackgroundGenerativeFillQualifier.ts b/src/qualifiers/background/shared/BackgroundGenerativeFillQualifier.ts index 57d47bc..b978077 100644 --- a/src/qualifiers/background/shared/BackgroundGenerativeFillQualifier.ts +++ b/src/qualifiers/background/shared/BackgroundGenerativeFillQualifier.ts @@ -1,5 +1,5 @@ -import {BackgroundQualifier} from "./base/BackgroundQualifier.js"; -import {IGenerativeFillBackgroundModel} from "../../../internal/models/createBackgroundModel.js"; +import { BackgroundQualifier } from "./base/BackgroundQualifier.js"; +import { IGenerativeFillBackgroundModel } from "../../../internal/models/createBackgroundModel.js"; /** * @description Automatically fills the padded area using generative AI to extend the image seamlessly. @@ -8,19 +8,19 @@ import {IGenerativeFillBackgroundModel} from "../../../internal/models/createBac */ class BackgroundGenerativeFillQualifier extends BackgroundQualifier { protected _prompt: string | undefined; - protected _backgroundType: 'generativeFill'; + protected _backgroundType: "generativeFill"; constructor(backgroundValue: string) { super(backgroundValue); this._prompt = getPromptFromBackgroundValue(backgroundValue); - this._backgroundType = 'generativeFill'; + this._backgroundType = "generativeFill"; } getPrompt(): string | undefined { return this._prompt; } - getBackgroundType(): 'generativeFill' { + getBackgroundType(): "generativeFill" { return this._backgroundType; } @@ -29,11 +29,11 @@ class BackgroundGenerativeFillQualifier extends BackgroundQualifier { * Override the toString() function to explicitly stringify the qualifier. */ toString(): string { - return `b_gen_fill${this._prompt ? `:prompt_${this._prompt}` : ''}`; + return `b_gen_fill${this._prompt ? `:prompt_${this._prompt}` : ""}`; } static createInstanceFromModel(backgroundModel: IGenerativeFillBackgroundModel): BackgroundGenerativeFillQualifier { - const backgroundValue = `gen_fill${backgroundModel.prompt ? `:prompt_${backgroundModel.prompt}` : ''}`; + const backgroundValue = `gen_fill${backgroundModel.prompt ? `:prompt_${backgroundModel.prompt}` : ""}`; return new BackgroundGenerativeFillQualifier(backgroundValue); } } @@ -42,18 +42,14 @@ class BackgroundGenerativeFillQualifier extends BackgroundQualifier { * @description Helper for checking if the background value is type of Generative Fill. */ function isGenerativeFillBackgroundValue(backgroundValue: unknown): boolean { - return typeof backgroundValue === 'string' && backgroundValue.startsWith('gen_fill'); + return typeof backgroundValue === "string" && backgroundValue.startsWith("gen_fill"); } /** * @description Helper for getting prompt from the Generative Fill background value. */ function getPromptFromBackgroundValue(backgroundValue: string): string | undefined { - return backgroundValue.split(':prompt_')[1]; + return backgroundValue.split(":prompt_")[1]; } -export { - BackgroundGenerativeFillQualifier, - isGenerativeFillBackgroundValue, - getPromptFromBackgroundValue -}; +export { BackgroundGenerativeFillQualifier, isGenerativeFillBackgroundValue, getPromptFromBackgroundValue }; diff --git a/src/qualifiers/background/shared/BlurredBackgroundAction.ts b/src/qualifiers/background/shared/BlurredBackgroundAction.ts index 1a29368..26afb9c 100644 --- a/src/qualifiers/background/shared/BlurredBackgroundAction.ts +++ b/src/qualifiers/background/shared/BlurredBackgroundAction.ts @@ -1,4 +1,4 @@ -import {BackgroundQualifier} from "./base/BackgroundQualifier.js"; +import { BackgroundQualifier } from "./base/BackgroundQualifier.js"; /** * @description A class for blurred background transformations. @@ -6,14 +6,14 @@ import {BackgroundQualifier} from "./base/BackgroundQualifier.js"; * @extends {Qualifiers.Background.BackgroundQualifier} */ class BlurredBackgroundAction extends BackgroundQualifier { - private intensityLevel:number; - private brightnessLevel:number; + private intensityLevel: number; + private brightnessLevel: number; /** * @description Sets the intensity of the blur. * @param {number} value - The intensity of the blur. */ - intensity(value:number): this { + intensity(value: number): this { this.intensityLevel = value; return this; } @@ -22,7 +22,7 @@ class BlurredBackgroundAction extends BackgroundQualifier { * @description Sets the brightness of the background. * @param {number} value - The brightness of the background. */ - brightness(value:number): this { + brightness(value: number): this { this.brightnessLevel = value; return this; } @@ -36,9 +36,9 @@ class BlurredBackgroundAction extends BackgroundQualifier { // b_blurred:{intensity}:{brightness} return ` b_blurred - ${this.intensityLevel ? `:${this.intensityLevel}` : ''} - ${this.brightnessLevel ? `:${this.brightnessLevel}` : ''} - `.replace(/\s+/g, ''); + ${this.intensityLevel ? `:${this.intensityLevel}` : ""} + ${this.brightnessLevel ? `:${this.brightnessLevel}` : ""} + `.replace(/\s+/g, ""); } } diff --git a/src/qualifiers/background/shared/auto/BackgroundAutoBorderQualifier.ts b/src/qualifiers/background/shared/auto/BackgroundAutoBorderQualifier.ts index 4553d23..67ac475 100644 --- a/src/qualifiers/background/shared/auto/BackgroundAutoBorderQualifier.ts +++ b/src/qualifiers/background/shared/auto/BackgroundAutoBorderQualifier.ts @@ -1,4 +1,4 @@ -import {BaseCommonBackground} from "../base/BaseCommonBackground.js"; +import { BaseCommonBackground } from "../base/BaseCommonBackground.js"; /** * @description Automatically determines the color to use for padding, if needed when resizing an asset. Selects the @@ -15,10 +15,10 @@ class BackgroundAutoBorderQualifier extends BaseCommonBackground { toString(): string { return ` b_auto:border - ${this._contrast ? '_contrast' : ''} - ${this._palette.length ? `:palette_${this._palette.join('_')}` : ''} - `.replace(/\s+/g, ''); + ${this._contrast ? "_contrast" : ""} + ${this._palette.length ? `:palette_${this._palette.join("_")}` : ""} + `.replace(/\s+/g, ""); } } -export {BackgroundAutoBorderQualifier}; +export { BackgroundAutoBorderQualifier }; diff --git a/src/qualifiers/background/shared/auto/BackgroundAutoPredominantQualifier.ts b/src/qualifiers/background/shared/auto/BackgroundAutoPredominantQualifier.ts index 1dab18d..b499f00 100644 --- a/src/qualifiers/background/shared/auto/BackgroundAutoPredominantQualifier.ts +++ b/src/qualifiers/background/shared/auto/BackgroundAutoPredominantQualifier.ts @@ -1,4 +1,4 @@ -import {BaseCommonBackground} from "../base/BaseCommonBackground.js"; +import { BaseCommonBackground } from "../base/BaseCommonBackground.js"; /** * @description Automatically determines the color to use for padding, if needed when resizing an asset. Selects the @@ -15,10 +15,10 @@ class BackgroundAutoPredominantQualifier extends BaseCommonBackground { toString(): string { return ` b_auto:predominant - ${this._contrast ? '_contrast' : ''} - ${this._palette.length ? `:palette_${this._palette.join('_')}` : ''} - `.replace(/\s+/g, ''); + ${this._contrast ? "_contrast" : ""} + ${this._palette.length ? `:palette_${this._palette.join("_")}` : ""} + `.replace(/\s+/g, ""); } } -export {BackgroundAutoPredominantQualifier}; +export { BackgroundAutoPredominantQualifier }; diff --git a/src/qualifiers/background/shared/base/BackgroundQualifier.ts b/src/qualifiers/background/shared/base/BackgroundQualifier.ts index 3380e15..64823a3 100644 --- a/src/qualifiers/background/shared/base/BackgroundQualifier.ts +++ b/src/qualifiers/background/shared/base/BackgroundQualifier.ts @@ -1,4 +1,4 @@ -import {Qualifier} from "../../../../internal/qualifier/Qualifier.js"; +import { Qualifier } from "../../../../internal/qualifier/Qualifier.js"; /** * @description Defines the visual appearance of the background. @@ -8,7 +8,7 @@ import {Qualifier} from "../../../../internal/qualifier/Qualifier.js"; class BackgroundQualifier extends Qualifier { constructor(backgroundValue?: string) { // The qualifier key for this qualifier - super('b'); + super("b"); // Such as color (b_red) if (backgroundValue) { @@ -17,4 +17,4 @@ class BackgroundQualifier extends Qualifier { } } -export {BackgroundQualifier}; +export { BackgroundQualifier }; diff --git a/src/qualifiers/background/shared/base/BaseCommonBackground.ts b/src/qualifiers/background/shared/base/BaseCommonBackground.ts index 36ce027..471ead6 100644 --- a/src/qualifiers/background/shared/base/BaseCommonBackground.ts +++ b/src/qualifiers/background/shared/base/BaseCommonBackground.ts @@ -1,6 +1,6 @@ -import {prepareColor} from "../../../../internal/utils/prepareColor.js"; -import {BackgroundQualifier} from "./BackgroundQualifier.js"; -import {SystemColors} from "../../../color.js"; +import { prepareColor } from "../../../../internal/utils/prepareColor.js"; +import { BackgroundQualifier } from "./BackgroundQualifier.js"; +import { SystemColors } from "../../../color.js"; /** * @description Defines the background color to use when resizing with padding. @@ -39,4 +39,4 @@ class BaseCommonBackground extends BackgroundQualifier { } } -export {BaseCommonBackground}; +export { BaseCommonBackground }; diff --git a/src/qualifiers/background/shared/base/BaseGradientBackground.ts b/src/qualifiers/background/shared/base/BaseGradientBackground.ts index e2fb961..d6031f3 100644 --- a/src/qualifiers/background/shared/base/BaseGradientBackground.ts +++ b/src/qualifiers/background/shared/base/BaseGradientBackground.ts @@ -1,6 +1,6 @@ -import {BaseCommonBackground} from "./BaseCommonBackground.js"; -import {GradientDirectionQualifierValue} from "../../../gradientDirection/GradientDirectionQualifierValue.js"; -import {GradientDirectionType} from "../../../../types/types.js"; +import { BaseCommonBackground } from "./BaseCommonBackground.js"; +import { GradientDirectionQualifierValue } from "../../../gradientDirection/GradientDirectionQualifierValue.js"; +import { GradientDirectionType } from "../../../../types/types.js"; /** * @description Defines the gradient fade effect to use for the background when resizing with padding. @@ -9,7 +9,7 @@ import {GradientDirectionType} from "../../../../types/types.js"; */ class BaseGradientBackground extends BaseCommonBackground { protected _gradientColors: number; - protected _gradientDirection: GradientDirectionType|GradientDirectionQualifierValue; + protected _gradientDirection: GradientDirectionType | GradientDirectionQualifierValue; /** * * @description Sets the number of predominant colors to use (2 or 4). @@ -33,4 +33,4 @@ class BaseGradientBackground extends BaseCommonBackground { } } -export {BaseGradientBackground}; +export { BaseGradientBackground }; diff --git a/src/qualifiers/background/shared/gradient/BackgroundBorderGradientQualifier.ts b/src/qualifiers/background/shared/gradient/BackgroundBorderGradientQualifier.ts index e0bfef7..68bdb9e 100644 --- a/src/qualifiers/background/shared/gradient/BackgroundBorderGradientQualifier.ts +++ b/src/qualifiers/background/shared/gradient/BackgroundBorderGradientQualifier.ts @@ -1,4 +1,4 @@ -import {BaseGradientBackground} from "../base/BaseGradientBackground.js"; +import { BaseGradientBackground } from "../base/BaseGradientBackground.js"; /** * @description Specifies that the gradient fade effect, used for the background when resizing with padding, uses the @@ -15,12 +15,12 @@ class BackgroundBorderGradientQualifier extends BaseGradientBackground { toString(): string { return ` b_auto:border_gradient - ${this._contrast ? '_contrast' : ''} - ${this._gradientColors ? `:${this._gradientColors}` : ''} - ${this._gradientDirection ? `:${this._gradientDirection}` : ''} - ${this._palette.length ? `:palette_${this._palette.join('_')}` : ''} - `.replace(/\s+/g, ''); + ${this._contrast ? "_contrast" : ""} + ${this._gradientColors ? `:${this._gradientColors}` : ""} + ${this._gradientDirection ? `:${this._gradientDirection}` : ""} + ${this._palette.length ? `:palette_${this._palette.join("_")}` : ""} + `.replace(/\s+/g, ""); } } -export {BackgroundBorderGradientQualifier}; +export { BackgroundBorderGradientQualifier }; diff --git a/src/qualifiers/background/shared/gradient/BackgroundPredominantGradientQualifier.ts b/src/qualifiers/background/shared/gradient/BackgroundPredominantGradientQualifier.ts index d843c32..773b125 100644 --- a/src/qualifiers/background/shared/gradient/BackgroundPredominantGradientQualifier.ts +++ b/src/qualifiers/background/shared/gradient/BackgroundPredominantGradientQualifier.ts @@ -1,4 +1,4 @@ -import {BaseGradientBackground} from "../base/BaseGradientBackground.js"; +import { BaseGradientBackground } from "../base/BaseGradientBackground.js"; /** * @description Specifies that the gradient fade effect, used for the background when resizing with padding, uses the @@ -15,12 +15,12 @@ class BackgroundPredominantGradientQualifier extends BaseGradientBackground { toString(): string { return ` b_auto:predominant_gradient - ${this._contrast ? '_contrast' : ''} - ${this._gradientColors ? `:${this._gradientColors}` : ''} - ${this._gradientDirection ? `:${this._gradientDirection}` : ''} - ${this._palette.length ? `:palette_${this._palette.join('_')}` : ''} - `.replace(/\s+/g, ''); + ${this._contrast ? "_contrast" : ""} + ${this._gradientColors ? `:${this._gradientColors}` : ""} + ${this._gradientDirection ? `:${this._gradientDirection}` : ""} + ${this._palette.length ? `:palette_${this._palette.join("_")}` : ""} + `.replace(/\s+/g, ""); } } -export {BackgroundPredominantGradientQualifier}; +export { BackgroundPredominantGradientQualifier }; diff --git a/src/qualifiers/blendMode.ts b/src/qualifiers/blendMode.ts index 32b6221..90111a1 100644 --- a/src/qualifiers/blendMode.ts +++ b/src/qualifiers/blendMode.ts @@ -1,4 +1,4 @@ -import {BlendModeQualifier} from "./blendMode/BlendModeQualifier.js"; +import { BlendModeQualifier } from "./blendMode/BlendModeQualifier.js"; /** * @description Defines the mode of blending to use when overlaying an image. * @@ -8,17 +8,14 @@ import {BlendModeQualifier} from "./blendMode/BlendModeQualifier.js"; * @see To be used with an {@link Actions.Overlay|Overlay} */ - - - /** * @summary qualifier * @memberOf Qualifiers.BlendMode * @description Add an overlay image blended using the 'multiply' blend mode. * @return {Qualifiers.BlendMode.BlendModeQualifier} */ -function multiply():BlendModeQualifier { - return new BlendModeQualifier('multiply'); +function multiply(): BlendModeQualifier { + return new BlendModeQualifier("multiply"); } /** @@ -27,8 +24,8 @@ function multiply():BlendModeQualifier { * @description Add an overlay image blended using the 'screen' blend mode. * @return {Qualifiers.BlendMode.BlendModeQualifier} */ -function screen():BlendModeQualifier { - return new BlendModeQualifier('screen'); +function screen(): BlendModeQualifier { + return new BlendModeQualifier("screen"); } /** @@ -37,8 +34,8 @@ function screen():BlendModeQualifier { * @description Add an overlay image blended using the 'overlay' blend mode. * @return {Qualifiers.BlendMode.BlendModeQualifier} */ -function overlay():BlendModeQualifier { - return new BlendModeQualifier('overlay'); +function overlay(): BlendModeQualifier { + return new BlendModeQualifier("overlay"); } /** @@ -47,11 +44,10 @@ function overlay():BlendModeQualifier { * @description Add an overlay image blended using the 'mask' blend mode. * @return {Qualifiers.BlendMode.BlendModeQualifier} */ -function mask():BlendModeQualifier { - return new BlendModeQualifier('mask'); +function mask(): BlendModeQualifier { + return new BlendModeQualifier("mask"); } - /** * @summary qualifier * @memberOf Qualifiers.BlendMode @@ -59,25 +55,16 @@ function mask():BlendModeQualifier { * @param {number} lvl The level of distortion. (Range: 1 to 100, Server default: 50) * @return {Qualifiers.BlendMode.BlendModeQualifier} */ -function antiRemoval(lvl?: number):BlendModeQualifier { - return new BlendModeQualifier('anti_removal', lvl); +function antiRemoval(lvl?: number): BlendModeQualifier { + return new BlendModeQualifier("anti_removal", lvl); } - const BlendMode = { screen, multiply, overlay, mask, - antiRemoval -}; - -export { - BlendMode, - screen, - multiply, - overlay, - mask, - antiRemoval + antiRemoval, }; +export { BlendMode, screen, multiply, overlay, mask, antiRemoval }; diff --git a/src/qualifiers/blendMode/BlendModeQualifier.ts b/src/qualifiers/blendMode/BlendModeQualifier.ts index 281a9b5..1e1246c 100644 --- a/src/qualifiers/blendMode/BlendModeQualifier.ts +++ b/src/qualifiers/blendMode/BlendModeQualifier.ts @@ -1,6 +1,6 @@ -import {Action} from "../../internal/Action.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { Action } from "../../internal/Action.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @description @@ -14,11 +14,10 @@ import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; * @extends SDK.Action */ class BlendModeQualifier extends Action { - constructor(blendMode:string, level?:number) { + constructor(blendMode: string, level?: number) { super(); - this.addQualifier(new Qualifier('e', new QualifierValue([blendMode, level]))); + this.addQualifier(new Qualifier("e", new QualifierValue([blendMode, level]))); } } - -export {BlendModeQualifier}; +export { BlendModeQualifier }; diff --git a/src/qualifiers/chromaSubSampling.ts b/src/qualifiers/chromaSubSampling.ts index 5592672..65a348b 100644 --- a/src/qualifiers/chromaSubSampling.ts +++ b/src/qualifiers/chromaSubSampling.ts @@ -1,16 +1,18 @@ - /** * @summary qualifier * @memberOf Qualifiers.ChromeSubSampling */ -function chroma444():number { return 444; } +function chroma444(): number { + return 444; +} /** * @summary qualifier * @memberOf Qualifiers.ChromeSubSampling */ -function chroma420():number { return 420; } - +function chroma420(): number { + return 420; +} /** * @description Contains functions to select the chroma subsampling setting. @@ -22,12 +24,7 @@ function chroma420():number { return 420; } */ const ChromaSubSampling = { chroma444, - chroma420 -}; - -export { - ChromaSubSampling, chroma420, - chroma444 }; +export { ChromaSubSampling, chroma420, chroma444 }; diff --git a/src/qualifiers/color.ts b/src/qualifiers/color.ts index e76cd9c..ac37511 100644 --- a/src/qualifiers/color.ts +++ b/src/qualifiers/color.ts @@ -10,678 +10,678 @@ */ const Color = { - SNOW:'snow', - SNOW1:'snow1', - SNOW2:'snow2', - ROSYBROWN1:'rosybrown1', - ROSYBROWN2:'rosybrown2', - SNOW3:'snow3', - LIGHTCORAL:'lightcoral', - INDIANRED1:'indianred1', - ROSYBROWN3:'rosybrown3', - INDIANRED2:'indianred2', - ROSYBROWN:'rosybrown', - BROWN1:'brown1', - FIREBRICK1:'firebrick1', - BROWN2:'brown2', - INDIANRED:'indianred', - INDIANRED3:'indianred3', - FIREBRICK2:'firebrick2', - SNOW4:'snow4', - BROWN3:'brown3', - RED:'red', - RED1:'red1', - ROSYBROWN4:'rosybrown4', - FIREBRICK3:'firebrick3', - RED2:'red2', - FIREBRICK:'firebrick', - BROWN:'brown', - RED3:'red3', - INDIANRED4:'indianred4', - BROWN4:'brown4', - FIREBRICK4:'firebrick4', - DARKRED:'darkred', - RED4:'red4', - LIGHTPINK1:'lightpink1', - LIGHTPINK3:'lightpink3', - LIGHTPINK4:'lightpink4', - LIGHTPINK2:'lightpink2', - LIGHTPINK:'lightpink', - PINK:'pink', - CRIMSON:'crimson', - PINK1:'pink1', - PINK2:'pink2', - PINK3:'pink3', - PINK4:'pink4', - PALEVIOLETRED4:'palevioletred4', - PALEVIOLETRED:'palevioletred', - PALEVIOLETRED2:'palevioletred2', - PALEVIOLETRED1:'palevioletred1', - PALEVIOLETRED3:'palevioletred3', - LAVENDERBLUSH:'lavenderblush', - LAVENDERBLUSH1:'lavenderblush1', - LAVENDERBLUSH3:'lavenderblush3', - LAVENDERBLUSH2:'lavenderblush2', - LAVENDERBLUSH4:'lavenderblush4', - MAROON:'maroon', - HOTPINK3:'hotpink3', - VIOLETRED3:'violetred3', - VIOLETRED1:'violetred1', - VIOLETRED2:'violetred2', - VIOLETRED4:'violetred4', - HOTPINK2:'hotpink2', - HOTPINK1:'hotpink1', - HOTPINK4:'hotpink4', - HOTPINK:'hotpink', - DEEPPINK:'deeppink', - DEEPPINK1:'deeppink1', - DEEPPINK2:'deeppink2', - DEEPPINK3:'deeppink3', - DEEPPINK4:'deeppink4', - MAROON1:'maroon1', - MAROON2:'maroon2', - MAROON3:'maroon3', - MAROON4:'maroon4', - MEDIUMVIOLETRED:'mediumvioletred', - VIOLETRED:'violetred', - ORCHID2:'orchid2', - ORCHID:'orchid', - ORCHID1:'orchid1', - ORCHID3:'orchid3', - ORCHID4:'orchid4', - THISTLE1:'thistle1', - THISTLE2:'thistle2', - PLUM1:'plum1', - PLUM2:'plum2', - THISTLE:'thistle', - THISTLE3:'thistle3', - PLUM:'plum', - VIOLET:'violet', - PLUM3:'plum3', - THISTLE4:'thistle4', - FUCHSIA:'fuchsia', - MAGENTA:'magenta', - MAGENTA1:'magenta1', - PLUM4:'plum4', - MAGENTA2:'magenta2', - MAGENTA3:'magenta3', - DARKMAGENTA:'darkmagenta', - MAGENTA4:'magenta4', - PURPLE:'purple', - MEDIUMORCHID:'mediumorchid', - MEDIUMORCHID1:'mediumorchid1', - MEDIUMORCHID2:'mediumorchid2', - MEDIUMORCHID3:'mediumorchid3', - MEDIUMORCHID4:'mediumorchid4', - DARKVIOLET:'darkviolet', - DARKORCHID:'darkorchid', - DARKORCHID1:'darkorchid1', - DARKORCHID3:'darkorchid3', - DARKORCHID2:'darkorchid2', - DARKORCHID4:'darkorchid4', - INDIGO:'indigo', - BLUEVIOLET:'blueviolet', - PURPLE2:'purple2', - PURPLE3:'purple3', - PURPLE4:'purple4', - PURPLE1:'purple1', - MEDIUMPURPLE:'mediumpurple', - MEDIUMPURPLE1:'mediumpurple1', - MEDIUMPURPLE2:'mediumpurple2', - MEDIUMPURPLE3:'mediumpurple3', - MEDIUMPURPLE4:'mediumpurple4', - DARKSLATEBLUE:'darkslateblue', - LIGHTSLATEBLUE:'lightslateblue', - MEDIUMSLATEBLUE:'mediumslateblue', - SLATEBLUE:'slateblue', - SLATEBLUE1:'slateblue1', - SLATEBLUE2:'slateblue2', - SLATEBLUE3:'slateblue3', - SLATEBLUE4:'slateblue4', - GHOSTWHITE:'ghostwhite', - LAVENDER:'lavender', - BLUE:'blue', - BLUE1:'blue1', - BLUE2:'blue2', - BLUE3:'blue3', - MEDIUMBLUE:'mediumblue', - BLUE4:'blue4', - DARKBLUE:'darkblue', - MIDNIGHTBLUE:'midnightblue', - NAVY:'navy', - NAVYBLUE:'navyblue', - ROYALBLUE:'royalblue', - ROYALBLUE1:'royalblue1', - ROYALBLUE2:'royalblue2', - ROYALBLUE3:'royalblue3', - ROYALBLUE4:'royalblue4', - CORNFLOWERBLUE:'cornflowerblue', - LIGHTSTEELBLUE:'lightsteelblue', - LIGHTSTEELBLUE1:'lightsteelblue1', - LIGHTSTEELBLUE2:'lightsteelblue2', - LIGHTSTEELBLUE3:'lightsteelblue3', - LIGHTSTEELBLUE4:'lightsteelblue4', - SLATEGRAY4:'slategray4', - SLATEGRAY1:'slategray1', - SLATEGRAY2:'slategray2', - SLATEGRAY3:'slategray3', - LIGHTSLATEGRAY:'lightslategray', - LIGHTSLATEGREY:'lightslategrey', - SLATEGRAY:'slategray', - SLATEGREY:'slategrey', - DODGERBLUE:'dodgerblue', - DODGERBLUE1:'dodgerblue1', - DODGERBLUE2:'dodgerblue2', - DODGERBLUE4:'dodgerblue4', - DODGERBLUE3:'dodgerblue3', - ALICEBLUE:'aliceblue', - STEELBLUE4:'steelblue4', - STEELBLUE:'steelblue', - STEELBLUE1:'steelblue1', - STEELBLUE2:'steelblue2', - STEELBLUE3:'steelblue3', - SKYBLUE4:'skyblue4', - SKYBLUE1:'skyblue1', - SKYBLUE2:'skyblue2', - SKYBLUE3:'skyblue3', - LIGHTSKYBLUE:'lightskyblue', - LIGHTSKYBLUE4:'lightskyblue4', - LIGHTSKYBLUE1:'lightskyblue1', - LIGHTSKYBLUE2:'lightskyblue2', - LIGHTSKYBLUE3:'lightskyblue3', - SKYBLUE:'skyblue', - LIGHTBLUE3:'lightblue3', - DEEPSKYBLUE:'deepskyblue', - DEEPSKYBLUE1:'deepskyblue1', - DEEPSKYBLUE2:'deepskyblue2', - DEEPSKYBLUE4:'deepskyblue4', - DEEPSKYBLUE3:'deepskyblue3', - LIGHTBLUE1:'lightblue1', - LIGHTBLUE2:'lightblue2', - LIGHTBLUE:'lightblue', - LIGHTBLUE4:'lightblue4', - POWDERBLUE:'powderblue', - CADETBLUE1:'cadetblue1', - CADETBLUE2:'cadetblue2', - CADETBLUE3:'cadetblue3', - CADETBLUE4:'cadetblue4', - TURQUOISE1:'turquoise1', - TURQUOISE2:'turquoise2', - TURQUOISE3:'turquoise3', - TURQUOISE4:'turquoise4', - CADETBLUE:'cadetblue', - DARKTURQUOISE:'darkturquoise', - AZURE:'azure', - AZURE1:'azure1', - LIGHTCYAN1:'lightcyan1', - LIGHTCYAN:'lightcyan', - AZURE2:'azure2', - LIGHTCYAN2:'lightcyan2', - PALETURQUOISE1:'paleturquoise1', - PALETURQUOISE:'paleturquoise', - PALETURQUOISE2:'paleturquoise2', - DARKSLATEGRAY1:'darkslategray1', - AZURE3:'azure3', - LIGHTCYAN3:'lightcyan3', - DARKSLATEGRAY2:'darkslategray2', - PALETURQUOISE3:'paleturquoise3', - DARKSLATEGRAY3:'darkslategray3', - AZURE4:'azure4', - LIGHTCYAN4:'lightcyan4', - AQUA:'aqua', - CYAN:'cyan', - CYAN1:'cyan1', - PALETURQUOISE4:'paleturquoise4', - CYAN2:'cyan2', - DARKSLATEGRAY4:'darkslategray4', - CYAN3:'cyan3', - CYAN4:'cyan4', - DARKCYAN:'darkcyan', - TEAL:'teal', - DARKSLATEGRAY:'darkslategray', - DARKSLATEGREY:'darkslategrey', - MEDIUMTURQUOISE:'mediumturquoise', - LIGHTSEAGREEN:'lightseagreen', - TURQUOISE:'turquoise', - AQUAMARINE4:'aquamarine4', - AQUAMARINE:'aquamarine', - AQUAMARINE1:'aquamarine1', - AQUAMARINE2:'aquamarine2', - AQUAMARINE3:'aquamarine3', - MEDIUMAQUAMARINE:'mediumaquamarine', - MEDIUMSPRINGGREEN:'mediumspringgreen', - MINTCREAM:'mintcream', - SPRINGGREEN:'springgreen', - SPRINGGREEN1:'springgreen1', - SPRINGGREEN2:'springgreen2', - SPRINGGREEN3:'springgreen3', - SPRINGGREEN4:'springgreen4', - MEDIUMSEAGREEN:'mediumseagreen', - SEAGREEN:'seagreen', - SEAGREEN3:'seagreen3', - SEAGREEN1:'seagreen1', - SEAGREEN4:'seagreen4', - SEAGREEN2:'seagreen2', - MEDIUMFORESTGREEN:'mediumforestgreen', - HONEYDEW:'honeydew', - HONEYDEW1:'honeydew1', - HONEYDEW2:'honeydew2', - DARKSEAGREEN1:'darkseagreen1', - DARKSEAGREEN2:'darkseagreen2', - PALEGREEN1:'palegreen1', - PALEGREEN:'palegreen', - HONEYDEW3:'honeydew3', - LIGHTGREEN:'lightgreen', - PALEGREEN2:'palegreen2', - DARKSEAGREEN3:'darkseagreen3', - DARKSEAGREEN:'darkseagreen', - PALEGREEN3:'palegreen3', - HONEYDEW4:'honeydew4', - GREEN1:'green1', - LIME:'lime', - LIMEGREEN:'limegreen', - DARKSEAGREEN4:'darkseagreen4', - GREEN2:'green2', - PALEGREEN4:'palegreen4', - GREEN3:'green3', - FORESTGREEN:'forestgreen', - GREEN4:'green4', - GREEN:'green', - DARKGREEN:'darkgreen', - LAWNGREEN:'lawngreen', - CHARTREUSE:'chartreuse', - CHARTREUSE1:'chartreuse1', - CHARTREUSE2:'chartreuse2', - CHARTREUSE3:'chartreuse3', - CHARTREUSE4:'chartreuse4', - GREENYELLOW:'greenyellow', - DARKOLIVEGREEN3:'darkolivegreen3', - DARKOLIVEGREEN1:'darkolivegreen1', - DARKOLIVEGREEN2:'darkolivegreen2', - DARKOLIVEGREEN4:'darkolivegreen4', - DARKOLIVEGREEN:'darkolivegreen', - OLIVEDRAB:'olivedrab', - OLIVEDRAB1:'olivedrab1', - OLIVEDRAB2:'olivedrab2', - OLIVEDRAB3:'olivedrab3', - YELLOWGREEN:'yellowgreen', - OLIVEDRAB4:'olivedrab4', - IVORY:'ivory', - IVORY1:'ivory1', - LIGHTYELLOW:'lightyellow', - LIGHTYELLOW1:'lightyellow1', - BEIGE:'beige', - IVORY2:'ivory2', - LIGHTGOLDENRODYELLOW:'lightgoldenrodyellow', - LIGHTYELLOW2:'lightyellow2', - IVORY3:'ivory3', - LIGHTYELLOW3:'lightyellow3', - IVORY4:'ivory4', - LIGHTYELLOW4:'lightyellow4', - YELLOW:'yellow', - YELLOW1:'yellow1', - YELLOW2:'yellow2', - YELLOW3:'yellow3', - YELLOW4:'yellow4', - OLIVE:'olive', - DARKKHAKI:'darkkhaki', - KHAKI2:'khaki2', - LEMONCHIFFON4:'lemonchiffon4', - KHAKI1:'khaki1', - KHAKI3:'khaki3', - KHAKI4:'khaki4', - PALEGOLDENROD:'palegoldenrod', - LEMONCHIFFON:'lemonchiffon', - LEMONCHIFFON1:'lemonchiffon1', - KHAKI:'khaki', - LEMONCHIFFON3:'lemonchiffon3', - LEMONCHIFFON2:'lemonchiffon2', - MEDIUMGOLDENROD:'mediumgoldenrod', - CORNSILK4:'cornsilk4', - GOLD:'gold', - GOLD1:'gold1', - GOLD2:'gold2', - GOLD3:'gold3', - GOLD4:'gold4', - LIGHTGOLDENROD:'lightgoldenrod', - LIGHTGOLDENROD4:'lightgoldenrod4', - LIGHTGOLDENROD1:'lightgoldenrod1', - LIGHTGOLDENROD3:'lightgoldenrod3', - LIGHTGOLDENROD2:'lightgoldenrod2', - CORNSILK3:'cornsilk3', - CORNSILK2:'cornsilk2', - CORNSILK:'cornsilk', - CORNSILK1:'cornsilk1', - GOLDENROD:'goldenrod', - GOLDENROD1:'goldenrod1', - GOLDENROD2:'goldenrod2', - GOLDENROD3:'goldenrod3', - GOLDENROD4:'goldenrod4', - DARKGOLDENROD:'darkgoldenrod', - DARKGOLDENROD1:'darkgoldenrod1', - DARKGOLDENROD2:'darkgoldenrod2', - DARKGOLDENROD3:'darkgoldenrod3', - DARKGOLDENROD4:'darkgoldenrod4', - FLORALWHITE:'floralwhite', - WHEAT2:'wheat2', - OLDLACE:'oldlace', - WHEAT:'wheat', - WHEAT1:'wheat1', - WHEAT3:'wheat3', - ORANGE:'orange', - ORANGE1:'orange1', - ORANGE2:'orange2', - ORANGE3:'orange3', - ORANGE4:'orange4', - WHEAT4:'wheat4', - MOCCASIN:'moccasin', - PAPAYAWHIP:'papayawhip', - NAVAJOWHITE3:'navajowhite3', - BLANCHEDALMOND:'blanchedalmond', - NAVAJOWHITE:'navajowhite', - NAVAJOWHITE1:'navajowhite1', - NAVAJOWHITE2:'navajowhite2', - NAVAJOWHITE4:'navajowhite4', - ANTIQUEWHITE4:'antiquewhite4', - ANTIQUEWHITE:'antiquewhite', - TAN:'tan', - BISQUE4:'bisque4', - BURLYWOOD:'burlywood', - ANTIQUEWHITE2:'antiquewhite2', - BURLYWOOD1:'burlywood1', - BURLYWOOD3:'burlywood3', - BURLYWOOD2:'burlywood2', - ANTIQUEWHITE1:'antiquewhite1', - BURLYWOOD4:'burlywood4', - ANTIQUEWHITE3:'antiquewhite3', - DARKORANGE:'darkorange', - BISQUE2:'bisque2', - BISQUE:'bisque', - BISQUE1:'bisque1', - BISQUE3:'bisque3', - DARKORANGE1:'darkorange1', - LINEN:'linen', - DARKORANGE2:'darkorange2', - DARKORANGE3:'darkorange3', - DARKORANGE4:'darkorange4', - PERU:'peru', - TAN1:'tan1', - TAN2:'tan2', - TAN3:'tan3', - TAN4:'tan4', - PEACHPUFF:'peachpuff', - PEACHPUFF1:'peachpuff1', - PEACHPUFF4:'peachpuff4', - PEACHPUFF2:'peachpuff2', - PEACHPUFF3:'peachpuff3', - SANDYBROWN:'sandybrown', - SEASHELL4:'seashell4', - SEASHELL2:'seashell2', - SEASHELL3:'seashell3', - CHOCOLATE:'chocolate', - CHOCOLATE1:'chocolate1', - CHOCOLATE2:'chocolate2', - CHOCOLATE3:'chocolate3', - CHOCOLATE4:'chocolate4', - SADDLEBROWN:'saddlebrown', - SEASHELL:'seashell', - SEASHELL1:'seashell1', - SIENNA4:'sienna4', - SIENNA:'sienna', - SIENNA1:'sienna1', - SIENNA2:'sienna2', - SIENNA3:'sienna3', - LIGHTSALMON3:'lightsalmon3', - LIGHTSALMON:'lightsalmon', - LIGHTSALMON1:'lightsalmon1', - LIGHTSALMON4:'lightsalmon4', - LIGHTSALMON2:'lightsalmon2', - CORAL:'coral', - ORANGERED:'orangered', - ORANGERED1:'orangered1', - ORANGERED2:'orangered2', - ORANGERED3:'orangered3', - ORANGERED4:'orangered4', - DARKSALMON:'darksalmon', - SALMON1:'salmon1', - SALMON2:'salmon2', - SALMON3:'salmon3', - SALMON4:'salmon4', - CORAL1:'coral1', - CORAL2:'coral2', - CORAL3:'coral3', - CORAL4:'coral4', - TOMATO4:'tomato4', - TOMATO:'tomato', - TOMATO1:'tomato1', - TOMATO2:'tomato2', - TOMATO3:'tomato3', - MISTYROSE4:'mistyrose4', - MISTYROSE2:'mistyrose2', - MISTYROSE:'mistyrose', - MISTYROSE1:'mistyrose1', - SALMON:'salmon', - MISTYROSE3:'mistyrose3', - WHITE:'white', - GRAY100:'gray100', - GREY100:'grey100', - GRAY99:'gray99', - GREY99:'grey99', - GRAY98:'gray98', - GREY98:'grey98', - GRAY97:'gray97', - GREY97:'grey97', - GRAY96:'gray96', - GREY96:'grey96', - WHITESMOKE:'whitesmoke', - GRAY95:'gray95', - GREY95:'grey95', - GRAY94:'gray94', - GREY94:'grey94', - GRAY93:'gray93', - GREY93:'grey93', - GRAY92:'gray92', - GREY92:'grey92', - GRAY91:'gray91', - GREY91:'grey91', - GRAY90:'gray90', - GREY90:'grey90', - GRAY89:'gray89', - GREY89:'grey89', - GRAY88:'gray88', - GREY88:'grey88', - GRAY87:'gray87', - GREY87:'grey87', - GAINSBORO:'gainsboro', - GRAY86:'gray86', - GREY86:'grey86', - GRAY85:'gray85', - GREY85:'grey85', - GRAY84:'gray84', - GREY84:'grey84', - GRAY83:'gray83', - GREY83:'grey83', - LIGHTGRAY:'lightgray', - LIGHTGREY:'lightgrey', - GRAY82:'gray82', - GREY82:'grey82', - GRAY81:'gray81', - GREY81:'grey81', - GRAY80:'gray80', - GREY80:'grey80', - GRAY79:'gray79', - GREY79:'grey79', - GRAY78:'gray78', - GREY78:'grey78', - GRAY77:'gray77', - GREY77:'grey77', - GRAY76:'gray76', - GREY76:'grey76', - SILVER:'silver', - GRAY75:'gray75', - GREY75:'grey75', - GRAY74:'gray74', - GREY74:'grey74', - GRAY73:'gray73', - GREY73:'grey73', - GRAY72:'gray72', - GREY72:'grey72', - GRAY71:'gray71', - GREY71:'grey71', - GRAY70:'gray70', - GREY70:'grey70', - GRAY69:'gray69', - GREY69:'grey69', - GRAY68:'gray68', - GREY68:'grey68', - GRAY67:'gray67', - GREY67:'grey67', - DARKGRAY:'darkgray', - DARKGREY:'darkgrey', - GRAY66:'gray66', - GREY66:'grey66', - GRAY65:'gray65', - GREY65:'grey65', - GRAY64:'gray64', - GREY64:'grey64', - GRAY63:'gray63', - GREY63:'grey63', - GRAY62:'gray62', - GREY62:'grey62', - GRAY61:'gray61', - GREY61:'grey61', - GRAY60:'gray60', - GREY60:'grey60', - GRAY59:'gray59', - GREY59:'grey59', - GRAY58:'gray58', - GREY58:'grey58', - GRAY57:'gray57', - GREY57:'grey57', - GRAY56:'gray56', - GREY56:'grey56', - GRAY55:'gray55', - GREY55:'grey55', - GRAY54:'gray54', - GREY54:'grey54', - GRAY53:'gray53', - GREY53:'grey53', - GRAY52:'gray52', - GREY52:'grey52', - GRAY51:'gray51', - GREY51:'grey51', - FRACTAL:'fractal', - GRAY50:'gray50', - GREY50:'grey50', - GRAY:'gray', - GREY:'grey', - GRAY49:'gray49', - GREY49:'grey49', - GRAY48:'gray48', - GREY48:'grey48', - GRAY47:'gray47', - GREY47:'grey47', - GRAY46:'gray46', - GREY46:'grey46', - GRAY45:'gray45', - GREY45:'grey45', - GRAY44:'gray44', - GREY44:'grey44', - GRAY43:'gray43', - GREY43:'grey43', - GRAY42:'gray42', - GREY42:'grey42', - DIMGRAY:'dimgray', - DIMGREY:'dimgrey', - GRAY41:'gray41', - GREY41:'grey41', - GRAY40:'gray40', - GREY40:'grey40', - GRAY39:'gray39', - GREY39:'grey39', - GRAY38:'gray38', - GREY38:'grey38', - GRAY37:'gray37', - GREY37:'grey37', - GRAY36:'gray36', - GREY36:'grey36', - GRAY35:'gray35', - GREY35:'grey35', - GRAY34:'gray34', - GREY34:'grey34', - GRAY33:'gray33', - GREY33:'grey33', - GRAY32:'gray32', - GREY32:'grey32', - GRAY31:'gray31', - GREY31:'grey31', - GRAY30:'gray30', - GREY30:'grey30', - GRAY29:'gray29', - GREY29:'grey29', - GRAY28:'gray28', - GREY28:'grey28', - GRAY27:'gray27', - GREY27:'grey27', - GRAY26:'gray26', - GREY26:'grey26', - GRAY25:'gray25', - GREY25:'grey25', - GRAY24:'gray24', - GREY24:'grey24', - GRAY23:'gray23', - GREY23:'grey23', - GRAY22:'gray22', - GREY22:'grey22', - GRAY21:'gray21', - GREY21:'grey21', - GRAY20:'gray20', - GREY20:'grey20', - GRAY19:'gray19', - GREY19:'grey19', - GRAY18:'gray18', - GREY18:'grey18', - GRAY17:'gray17', - GREY17:'grey17', - GRAY16:'gray16', - GREY16:'grey16', - GRAY15:'gray15', - GREY15:'grey15', - GRAY14:'gray14', - GREY14:'grey14', - GRAY13:'gray13', - GREY13:'grey13', - GRAY12:'gray12', - GREY12:'grey12', - GRAY11:'gray11', - GREY11:'grey11', - GRAY10:'gray10', - GREY10:'grey10', - GRAY9:'gray9', - GREY9:'grey9', - GRAY8:'gray8', - GREY8:'grey8', - GRAY7:'gray7', - GREY7:'grey7', - GRAY6:'gray6', - GREY6:'grey6', - GRAY5:'gray5', - GREY5:'grey5', - GRAY4:'gray4', - GREY4:'grey4', - GRAY3:'gray3', - GREY3:'grey3', - GRAY2:'gray2', - GREY2:'grey2', - GRAY1:'gray1', - GREY1:'grey1', - BLACK:'black', - GRAY0:'gray0', - GREY0:'grey0', - OPAQUE:'opaque', - NONE:'none', - TRANSPARENT:'transparent' + SNOW: "snow", + SNOW1: "snow1", + SNOW2: "snow2", + ROSYBROWN1: "rosybrown1", + ROSYBROWN2: "rosybrown2", + SNOW3: "snow3", + LIGHTCORAL: "lightcoral", + INDIANRED1: "indianred1", + ROSYBROWN3: "rosybrown3", + INDIANRED2: "indianred2", + ROSYBROWN: "rosybrown", + BROWN1: "brown1", + FIREBRICK1: "firebrick1", + BROWN2: "brown2", + INDIANRED: "indianred", + INDIANRED3: "indianred3", + FIREBRICK2: "firebrick2", + SNOW4: "snow4", + BROWN3: "brown3", + RED: "red", + RED1: "red1", + ROSYBROWN4: "rosybrown4", + FIREBRICK3: "firebrick3", + RED2: "red2", + FIREBRICK: "firebrick", + BROWN: "brown", + RED3: "red3", + INDIANRED4: "indianred4", + BROWN4: "brown4", + FIREBRICK4: "firebrick4", + DARKRED: "darkred", + RED4: "red4", + LIGHTPINK1: "lightpink1", + LIGHTPINK3: "lightpink3", + LIGHTPINK4: "lightpink4", + LIGHTPINK2: "lightpink2", + LIGHTPINK: "lightpink", + PINK: "pink", + CRIMSON: "crimson", + PINK1: "pink1", + PINK2: "pink2", + PINK3: "pink3", + PINK4: "pink4", + PALEVIOLETRED4: "palevioletred4", + PALEVIOLETRED: "palevioletred", + PALEVIOLETRED2: "palevioletred2", + PALEVIOLETRED1: "palevioletred1", + PALEVIOLETRED3: "palevioletred3", + LAVENDERBLUSH: "lavenderblush", + LAVENDERBLUSH1: "lavenderblush1", + LAVENDERBLUSH3: "lavenderblush3", + LAVENDERBLUSH2: "lavenderblush2", + LAVENDERBLUSH4: "lavenderblush4", + MAROON: "maroon", + HOTPINK3: "hotpink3", + VIOLETRED3: "violetred3", + VIOLETRED1: "violetred1", + VIOLETRED2: "violetred2", + VIOLETRED4: "violetred4", + HOTPINK2: "hotpink2", + HOTPINK1: "hotpink1", + HOTPINK4: "hotpink4", + HOTPINK: "hotpink", + DEEPPINK: "deeppink", + DEEPPINK1: "deeppink1", + DEEPPINK2: "deeppink2", + DEEPPINK3: "deeppink3", + DEEPPINK4: "deeppink4", + MAROON1: "maroon1", + MAROON2: "maroon2", + MAROON3: "maroon3", + MAROON4: "maroon4", + MEDIUMVIOLETRED: "mediumvioletred", + VIOLETRED: "violetred", + ORCHID2: "orchid2", + ORCHID: "orchid", + ORCHID1: "orchid1", + ORCHID3: "orchid3", + ORCHID4: "orchid4", + THISTLE1: "thistle1", + THISTLE2: "thistle2", + PLUM1: "plum1", + PLUM2: "plum2", + THISTLE: "thistle", + THISTLE3: "thistle3", + PLUM: "plum", + VIOLET: "violet", + PLUM3: "plum3", + THISTLE4: "thistle4", + FUCHSIA: "fuchsia", + MAGENTA: "magenta", + MAGENTA1: "magenta1", + PLUM4: "plum4", + MAGENTA2: "magenta2", + MAGENTA3: "magenta3", + DARKMAGENTA: "darkmagenta", + MAGENTA4: "magenta4", + PURPLE: "purple", + MEDIUMORCHID: "mediumorchid", + MEDIUMORCHID1: "mediumorchid1", + MEDIUMORCHID2: "mediumorchid2", + MEDIUMORCHID3: "mediumorchid3", + MEDIUMORCHID4: "mediumorchid4", + DARKVIOLET: "darkviolet", + DARKORCHID: "darkorchid", + DARKORCHID1: "darkorchid1", + DARKORCHID3: "darkorchid3", + DARKORCHID2: "darkorchid2", + DARKORCHID4: "darkorchid4", + INDIGO: "indigo", + BLUEVIOLET: "blueviolet", + PURPLE2: "purple2", + PURPLE3: "purple3", + PURPLE4: "purple4", + PURPLE1: "purple1", + MEDIUMPURPLE: "mediumpurple", + MEDIUMPURPLE1: "mediumpurple1", + MEDIUMPURPLE2: "mediumpurple2", + MEDIUMPURPLE3: "mediumpurple3", + MEDIUMPURPLE4: "mediumpurple4", + DARKSLATEBLUE: "darkslateblue", + LIGHTSLATEBLUE: "lightslateblue", + MEDIUMSLATEBLUE: "mediumslateblue", + SLATEBLUE: "slateblue", + SLATEBLUE1: "slateblue1", + SLATEBLUE2: "slateblue2", + SLATEBLUE3: "slateblue3", + SLATEBLUE4: "slateblue4", + GHOSTWHITE: "ghostwhite", + LAVENDER: "lavender", + BLUE: "blue", + BLUE1: "blue1", + BLUE2: "blue2", + BLUE3: "blue3", + MEDIUMBLUE: "mediumblue", + BLUE4: "blue4", + DARKBLUE: "darkblue", + MIDNIGHTBLUE: "midnightblue", + NAVY: "navy", + NAVYBLUE: "navyblue", + ROYALBLUE: "royalblue", + ROYALBLUE1: "royalblue1", + ROYALBLUE2: "royalblue2", + ROYALBLUE3: "royalblue3", + ROYALBLUE4: "royalblue4", + CORNFLOWERBLUE: "cornflowerblue", + LIGHTSTEELBLUE: "lightsteelblue", + LIGHTSTEELBLUE1: "lightsteelblue1", + LIGHTSTEELBLUE2: "lightsteelblue2", + LIGHTSTEELBLUE3: "lightsteelblue3", + LIGHTSTEELBLUE4: "lightsteelblue4", + SLATEGRAY4: "slategray4", + SLATEGRAY1: "slategray1", + SLATEGRAY2: "slategray2", + SLATEGRAY3: "slategray3", + LIGHTSLATEGRAY: "lightslategray", + LIGHTSLATEGREY: "lightslategrey", + SLATEGRAY: "slategray", + SLATEGREY: "slategrey", + DODGERBLUE: "dodgerblue", + DODGERBLUE1: "dodgerblue1", + DODGERBLUE2: "dodgerblue2", + DODGERBLUE4: "dodgerblue4", + DODGERBLUE3: "dodgerblue3", + ALICEBLUE: "aliceblue", + STEELBLUE4: "steelblue4", + STEELBLUE: "steelblue", + STEELBLUE1: "steelblue1", + STEELBLUE2: "steelblue2", + STEELBLUE3: "steelblue3", + SKYBLUE4: "skyblue4", + SKYBLUE1: "skyblue1", + SKYBLUE2: "skyblue2", + SKYBLUE3: "skyblue3", + LIGHTSKYBLUE: "lightskyblue", + LIGHTSKYBLUE4: "lightskyblue4", + LIGHTSKYBLUE1: "lightskyblue1", + LIGHTSKYBLUE2: "lightskyblue2", + LIGHTSKYBLUE3: "lightskyblue3", + SKYBLUE: "skyblue", + LIGHTBLUE3: "lightblue3", + DEEPSKYBLUE: "deepskyblue", + DEEPSKYBLUE1: "deepskyblue1", + DEEPSKYBLUE2: "deepskyblue2", + DEEPSKYBLUE4: "deepskyblue4", + DEEPSKYBLUE3: "deepskyblue3", + LIGHTBLUE1: "lightblue1", + LIGHTBLUE2: "lightblue2", + LIGHTBLUE: "lightblue", + LIGHTBLUE4: "lightblue4", + POWDERBLUE: "powderblue", + CADETBLUE1: "cadetblue1", + CADETBLUE2: "cadetblue2", + CADETBLUE3: "cadetblue3", + CADETBLUE4: "cadetblue4", + TURQUOISE1: "turquoise1", + TURQUOISE2: "turquoise2", + TURQUOISE3: "turquoise3", + TURQUOISE4: "turquoise4", + CADETBLUE: "cadetblue", + DARKTURQUOISE: "darkturquoise", + AZURE: "azure", + AZURE1: "azure1", + LIGHTCYAN1: "lightcyan1", + LIGHTCYAN: "lightcyan", + AZURE2: "azure2", + LIGHTCYAN2: "lightcyan2", + PALETURQUOISE1: "paleturquoise1", + PALETURQUOISE: "paleturquoise", + PALETURQUOISE2: "paleturquoise2", + DARKSLATEGRAY1: "darkslategray1", + AZURE3: "azure3", + LIGHTCYAN3: "lightcyan3", + DARKSLATEGRAY2: "darkslategray2", + PALETURQUOISE3: "paleturquoise3", + DARKSLATEGRAY3: "darkslategray3", + AZURE4: "azure4", + LIGHTCYAN4: "lightcyan4", + AQUA: "aqua", + CYAN: "cyan", + CYAN1: "cyan1", + PALETURQUOISE4: "paleturquoise4", + CYAN2: "cyan2", + DARKSLATEGRAY4: "darkslategray4", + CYAN3: "cyan3", + CYAN4: "cyan4", + DARKCYAN: "darkcyan", + TEAL: "teal", + DARKSLATEGRAY: "darkslategray", + DARKSLATEGREY: "darkslategrey", + MEDIUMTURQUOISE: "mediumturquoise", + LIGHTSEAGREEN: "lightseagreen", + TURQUOISE: "turquoise", + AQUAMARINE4: "aquamarine4", + AQUAMARINE: "aquamarine", + AQUAMARINE1: "aquamarine1", + AQUAMARINE2: "aquamarine2", + AQUAMARINE3: "aquamarine3", + MEDIUMAQUAMARINE: "mediumaquamarine", + MEDIUMSPRINGGREEN: "mediumspringgreen", + MINTCREAM: "mintcream", + SPRINGGREEN: "springgreen", + SPRINGGREEN1: "springgreen1", + SPRINGGREEN2: "springgreen2", + SPRINGGREEN3: "springgreen3", + SPRINGGREEN4: "springgreen4", + MEDIUMSEAGREEN: "mediumseagreen", + SEAGREEN: "seagreen", + SEAGREEN3: "seagreen3", + SEAGREEN1: "seagreen1", + SEAGREEN4: "seagreen4", + SEAGREEN2: "seagreen2", + MEDIUMFORESTGREEN: "mediumforestgreen", + HONEYDEW: "honeydew", + HONEYDEW1: "honeydew1", + HONEYDEW2: "honeydew2", + DARKSEAGREEN1: "darkseagreen1", + DARKSEAGREEN2: "darkseagreen2", + PALEGREEN1: "palegreen1", + PALEGREEN: "palegreen", + HONEYDEW3: "honeydew3", + LIGHTGREEN: "lightgreen", + PALEGREEN2: "palegreen2", + DARKSEAGREEN3: "darkseagreen3", + DARKSEAGREEN: "darkseagreen", + PALEGREEN3: "palegreen3", + HONEYDEW4: "honeydew4", + GREEN1: "green1", + LIME: "lime", + LIMEGREEN: "limegreen", + DARKSEAGREEN4: "darkseagreen4", + GREEN2: "green2", + PALEGREEN4: "palegreen4", + GREEN3: "green3", + FORESTGREEN: "forestgreen", + GREEN4: "green4", + GREEN: "green", + DARKGREEN: "darkgreen", + LAWNGREEN: "lawngreen", + CHARTREUSE: "chartreuse", + CHARTREUSE1: "chartreuse1", + CHARTREUSE2: "chartreuse2", + CHARTREUSE3: "chartreuse3", + CHARTREUSE4: "chartreuse4", + GREENYELLOW: "greenyellow", + DARKOLIVEGREEN3: "darkolivegreen3", + DARKOLIVEGREEN1: "darkolivegreen1", + DARKOLIVEGREEN2: "darkolivegreen2", + DARKOLIVEGREEN4: "darkolivegreen4", + DARKOLIVEGREEN: "darkolivegreen", + OLIVEDRAB: "olivedrab", + OLIVEDRAB1: "olivedrab1", + OLIVEDRAB2: "olivedrab2", + OLIVEDRAB3: "olivedrab3", + YELLOWGREEN: "yellowgreen", + OLIVEDRAB4: "olivedrab4", + IVORY: "ivory", + IVORY1: "ivory1", + LIGHTYELLOW: "lightyellow", + LIGHTYELLOW1: "lightyellow1", + BEIGE: "beige", + IVORY2: "ivory2", + LIGHTGOLDENRODYELLOW: "lightgoldenrodyellow", + LIGHTYELLOW2: "lightyellow2", + IVORY3: "ivory3", + LIGHTYELLOW3: "lightyellow3", + IVORY4: "ivory4", + LIGHTYELLOW4: "lightyellow4", + YELLOW: "yellow", + YELLOW1: "yellow1", + YELLOW2: "yellow2", + YELLOW3: "yellow3", + YELLOW4: "yellow4", + OLIVE: "olive", + DARKKHAKI: "darkkhaki", + KHAKI2: "khaki2", + LEMONCHIFFON4: "lemonchiffon4", + KHAKI1: "khaki1", + KHAKI3: "khaki3", + KHAKI4: "khaki4", + PALEGOLDENROD: "palegoldenrod", + LEMONCHIFFON: "lemonchiffon", + LEMONCHIFFON1: "lemonchiffon1", + KHAKI: "khaki", + LEMONCHIFFON3: "lemonchiffon3", + LEMONCHIFFON2: "lemonchiffon2", + MEDIUMGOLDENROD: "mediumgoldenrod", + CORNSILK4: "cornsilk4", + GOLD: "gold", + GOLD1: "gold1", + GOLD2: "gold2", + GOLD3: "gold3", + GOLD4: "gold4", + LIGHTGOLDENROD: "lightgoldenrod", + LIGHTGOLDENROD4: "lightgoldenrod4", + LIGHTGOLDENROD1: "lightgoldenrod1", + LIGHTGOLDENROD3: "lightgoldenrod3", + LIGHTGOLDENROD2: "lightgoldenrod2", + CORNSILK3: "cornsilk3", + CORNSILK2: "cornsilk2", + CORNSILK: "cornsilk", + CORNSILK1: "cornsilk1", + GOLDENROD: "goldenrod", + GOLDENROD1: "goldenrod1", + GOLDENROD2: "goldenrod2", + GOLDENROD3: "goldenrod3", + GOLDENROD4: "goldenrod4", + DARKGOLDENROD: "darkgoldenrod", + DARKGOLDENROD1: "darkgoldenrod1", + DARKGOLDENROD2: "darkgoldenrod2", + DARKGOLDENROD3: "darkgoldenrod3", + DARKGOLDENROD4: "darkgoldenrod4", + FLORALWHITE: "floralwhite", + WHEAT2: "wheat2", + OLDLACE: "oldlace", + WHEAT: "wheat", + WHEAT1: "wheat1", + WHEAT3: "wheat3", + ORANGE: "orange", + ORANGE1: "orange1", + ORANGE2: "orange2", + ORANGE3: "orange3", + ORANGE4: "orange4", + WHEAT4: "wheat4", + MOCCASIN: "moccasin", + PAPAYAWHIP: "papayawhip", + NAVAJOWHITE3: "navajowhite3", + BLANCHEDALMOND: "blanchedalmond", + NAVAJOWHITE: "navajowhite", + NAVAJOWHITE1: "navajowhite1", + NAVAJOWHITE2: "navajowhite2", + NAVAJOWHITE4: "navajowhite4", + ANTIQUEWHITE4: "antiquewhite4", + ANTIQUEWHITE: "antiquewhite", + TAN: "tan", + BISQUE4: "bisque4", + BURLYWOOD: "burlywood", + ANTIQUEWHITE2: "antiquewhite2", + BURLYWOOD1: "burlywood1", + BURLYWOOD3: "burlywood3", + BURLYWOOD2: "burlywood2", + ANTIQUEWHITE1: "antiquewhite1", + BURLYWOOD4: "burlywood4", + ANTIQUEWHITE3: "antiquewhite3", + DARKORANGE: "darkorange", + BISQUE2: "bisque2", + BISQUE: "bisque", + BISQUE1: "bisque1", + BISQUE3: "bisque3", + DARKORANGE1: "darkorange1", + LINEN: "linen", + DARKORANGE2: "darkorange2", + DARKORANGE3: "darkorange3", + DARKORANGE4: "darkorange4", + PERU: "peru", + TAN1: "tan1", + TAN2: "tan2", + TAN3: "tan3", + TAN4: "tan4", + PEACHPUFF: "peachpuff", + PEACHPUFF1: "peachpuff1", + PEACHPUFF4: "peachpuff4", + PEACHPUFF2: "peachpuff2", + PEACHPUFF3: "peachpuff3", + SANDYBROWN: "sandybrown", + SEASHELL4: "seashell4", + SEASHELL2: "seashell2", + SEASHELL3: "seashell3", + CHOCOLATE: "chocolate", + CHOCOLATE1: "chocolate1", + CHOCOLATE2: "chocolate2", + CHOCOLATE3: "chocolate3", + CHOCOLATE4: "chocolate4", + SADDLEBROWN: "saddlebrown", + SEASHELL: "seashell", + SEASHELL1: "seashell1", + SIENNA4: "sienna4", + SIENNA: "sienna", + SIENNA1: "sienna1", + SIENNA2: "sienna2", + SIENNA3: "sienna3", + LIGHTSALMON3: "lightsalmon3", + LIGHTSALMON: "lightsalmon", + LIGHTSALMON1: "lightsalmon1", + LIGHTSALMON4: "lightsalmon4", + LIGHTSALMON2: "lightsalmon2", + CORAL: "coral", + ORANGERED: "orangered", + ORANGERED1: "orangered1", + ORANGERED2: "orangered2", + ORANGERED3: "orangered3", + ORANGERED4: "orangered4", + DARKSALMON: "darksalmon", + SALMON1: "salmon1", + SALMON2: "salmon2", + SALMON3: "salmon3", + SALMON4: "salmon4", + CORAL1: "coral1", + CORAL2: "coral2", + CORAL3: "coral3", + CORAL4: "coral4", + TOMATO4: "tomato4", + TOMATO: "tomato", + TOMATO1: "tomato1", + TOMATO2: "tomato2", + TOMATO3: "tomato3", + MISTYROSE4: "mistyrose4", + MISTYROSE2: "mistyrose2", + MISTYROSE: "mistyrose", + MISTYROSE1: "mistyrose1", + SALMON: "salmon", + MISTYROSE3: "mistyrose3", + WHITE: "white", + GRAY100: "gray100", + GREY100: "grey100", + GRAY99: "gray99", + GREY99: "grey99", + GRAY98: "gray98", + GREY98: "grey98", + GRAY97: "gray97", + GREY97: "grey97", + GRAY96: "gray96", + GREY96: "grey96", + WHITESMOKE: "whitesmoke", + GRAY95: "gray95", + GREY95: "grey95", + GRAY94: "gray94", + GREY94: "grey94", + GRAY93: "gray93", + GREY93: "grey93", + GRAY92: "gray92", + GREY92: "grey92", + GRAY91: "gray91", + GREY91: "grey91", + GRAY90: "gray90", + GREY90: "grey90", + GRAY89: "gray89", + GREY89: "grey89", + GRAY88: "gray88", + GREY88: "grey88", + GRAY87: "gray87", + GREY87: "grey87", + GAINSBORO: "gainsboro", + GRAY86: "gray86", + GREY86: "grey86", + GRAY85: "gray85", + GREY85: "grey85", + GRAY84: "gray84", + GREY84: "grey84", + GRAY83: "gray83", + GREY83: "grey83", + LIGHTGRAY: "lightgray", + LIGHTGREY: "lightgrey", + GRAY82: "gray82", + GREY82: "grey82", + GRAY81: "gray81", + GREY81: "grey81", + GRAY80: "gray80", + GREY80: "grey80", + GRAY79: "gray79", + GREY79: "grey79", + GRAY78: "gray78", + GREY78: "grey78", + GRAY77: "gray77", + GREY77: "grey77", + GRAY76: "gray76", + GREY76: "grey76", + SILVER: "silver", + GRAY75: "gray75", + GREY75: "grey75", + GRAY74: "gray74", + GREY74: "grey74", + GRAY73: "gray73", + GREY73: "grey73", + GRAY72: "gray72", + GREY72: "grey72", + GRAY71: "gray71", + GREY71: "grey71", + GRAY70: "gray70", + GREY70: "grey70", + GRAY69: "gray69", + GREY69: "grey69", + GRAY68: "gray68", + GREY68: "grey68", + GRAY67: "gray67", + GREY67: "grey67", + DARKGRAY: "darkgray", + DARKGREY: "darkgrey", + GRAY66: "gray66", + GREY66: "grey66", + GRAY65: "gray65", + GREY65: "grey65", + GRAY64: "gray64", + GREY64: "grey64", + GRAY63: "gray63", + GREY63: "grey63", + GRAY62: "gray62", + GREY62: "grey62", + GRAY61: "gray61", + GREY61: "grey61", + GRAY60: "gray60", + GREY60: "grey60", + GRAY59: "gray59", + GREY59: "grey59", + GRAY58: "gray58", + GREY58: "grey58", + GRAY57: "gray57", + GREY57: "grey57", + GRAY56: "gray56", + GREY56: "grey56", + GRAY55: "gray55", + GREY55: "grey55", + GRAY54: "gray54", + GREY54: "grey54", + GRAY53: "gray53", + GREY53: "grey53", + GRAY52: "gray52", + GREY52: "grey52", + GRAY51: "gray51", + GREY51: "grey51", + FRACTAL: "fractal", + GRAY50: "gray50", + GREY50: "grey50", + GRAY: "gray", + GREY: "grey", + GRAY49: "gray49", + GREY49: "grey49", + GRAY48: "gray48", + GREY48: "grey48", + GRAY47: "gray47", + GREY47: "grey47", + GRAY46: "gray46", + GREY46: "grey46", + GRAY45: "gray45", + GREY45: "grey45", + GRAY44: "gray44", + GREY44: "grey44", + GRAY43: "gray43", + GREY43: "grey43", + GRAY42: "gray42", + GREY42: "grey42", + DIMGRAY: "dimgray", + DIMGREY: "dimgrey", + GRAY41: "gray41", + GREY41: "grey41", + GRAY40: "gray40", + GREY40: "grey40", + GRAY39: "gray39", + GREY39: "grey39", + GRAY38: "gray38", + GREY38: "grey38", + GRAY37: "gray37", + GREY37: "grey37", + GRAY36: "gray36", + GREY36: "grey36", + GRAY35: "gray35", + GREY35: "grey35", + GRAY34: "gray34", + GREY34: "grey34", + GRAY33: "gray33", + GREY33: "grey33", + GRAY32: "gray32", + GREY32: "grey32", + GRAY31: "gray31", + GREY31: "grey31", + GRAY30: "gray30", + GREY30: "grey30", + GRAY29: "gray29", + GREY29: "grey29", + GRAY28: "gray28", + GREY28: "grey28", + GRAY27: "gray27", + GREY27: "grey27", + GRAY26: "gray26", + GREY26: "grey26", + GRAY25: "gray25", + GREY25: "grey25", + GRAY24: "gray24", + GREY24: "grey24", + GRAY23: "gray23", + GREY23: "grey23", + GRAY22: "gray22", + GREY22: "grey22", + GRAY21: "gray21", + GREY21: "grey21", + GRAY20: "gray20", + GREY20: "grey20", + GRAY19: "gray19", + GREY19: "grey19", + GRAY18: "gray18", + GREY18: "grey18", + GRAY17: "gray17", + GREY17: "grey17", + GRAY16: "gray16", + GREY16: "grey16", + GRAY15: "gray15", + GREY15: "grey15", + GRAY14: "gray14", + GREY14: "grey14", + GRAY13: "gray13", + GREY13: "grey13", + GRAY12: "gray12", + GREY12: "grey12", + GRAY11: "gray11", + GREY11: "grey11", + GRAY10: "gray10", + GREY10: "grey10", + GRAY9: "gray9", + GREY9: "grey9", + GRAY8: "gray8", + GREY8: "grey8", + GRAY7: "gray7", + GREY7: "grey7", + GRAY6: "gray6", + GREY6: "grey6", + GRAY5: "gray5", + GREY5: "grey5", + GRAY4: "gray4", + GREY4: "grey4", + GRAY3: "gray3", + GREY3: "grey3", + GRAY2: "gray2", + GREY2: "grey2", + GRAY1: "gray1", + GREY1: "grey1", + BLACK: "black", + GRAY0: "gray0", + GREY0: "grey0", + OPAQUE: "opaque", + NONE: "none", + TRANSPARENT: "transparent", }; -export {Color}; +export { Color }; export type SystemColors = keyof typeof Color | string; diff --git a/src/qualifiers/colorSpace.ts b/src/qualifiers/colorSpace.ts index 2c7718a..7c99add 100644 --- a/src/qualifiers/colorSpace.ts +++ b/src/qualifiers/colorSpace.ts @@ -5,14 +5,14 @@ * @see Visit {@link Actions.Delivery.colorSpace|Delivery Color Space} for an example */ -import {ColorSpaceType} from "../types/types.js"; +import { ColorSpaceType } from "../types/types.js"; /** * @summary qualifier * @memberOf Qualifiers.ColorSpace */ function srgb(): ColorSpaceType { - return 'srgb'; + return "srgb"; } /** @@ -20,61 +20,48 @@ function srgb(): ColorSpaceType { * @memberOf Qualifiers.ColorSpace */ function trueColor(): ColorSpaceType { - return 'srgb:truecolor'; + return "srgb:truecolor"; } - /** * @summary qualifier * @memberOf Qualifiers.ColorSpace */ function tinySrgb(): ColorSpaceType { - return 'tinysrgb'; + return "tinysrgb"; } - /** * @summary qualifier * @memberOf Qualifiers.ColorSpace */ function cmyk(): ColorSpaceType { - return 'cmyk'; + return "cmyk"; } - /** * @summary qualifier * @memberOf Qualifiers.ColorSpace */ function noCmyk(): ColorSpaceType { - return 'no_cmyk'; + return "no_cmyk"; } - /** * @summary qualifier * @memberOf Qualifiers.ColorSpace */ function keepCmyk(): ColorSpaceType { - return 'keep_cmyk'; + return "keep_cmyk"; } -const ColorSpace: RecordColorSpaceType> = { - cmyk, - keepCmyk, - noCmyk, - srgb, - tinySrgb, - trueColor -}; - -export { - ColorSpace, +const ColorSpace: Record ColorSpaceType> = { cmyk, keepCmyk, noCmyk, srgb, tinySrgb, - trueColor + trueColor, }; +export { ColorSpace, cmyk, keepCmyk, noCmyk, srgb, tinySrgb, trueColor }; diff --git a/src/qualifiers/compass.ts b/src/qualifiers/compass.ts index 0eeff02..2176e42 100644 --- a/src/qualifiers/compass.ts +++ b/src/qualifiers/compass.ts @@ -1,5 +1,4 @@ -import {CompassQualifier} from "./gravity/qualifiers/compass/CompassQualifier.js"; - +import { CompassQualifier } from "./gravity/qualifiers/compass/CompassQualifier.js"; /** * @summary qualifier @@ -8,7 +7,7 @@ import {CompassQualifier} from "./gravity/qualifiers/compass/CompassQualifier.js * @return {Qualifiers.Compass.CompassQualifier} Compass */ function south(): CompassQualifier { - return new CompassQualifier('south'); + return new CompassQualifier("south"); } /** @@ -18,7 +17,7 @@ function south(): CompassQualifier { * @return {Qualifiers.Compass.CompassQualifier} Compass */ function north(): CompassQualifier { - return new CompassQualifier('north'); + return new CompassQualifier("north"); } /** @@ -28,7 +27,7 @@ function north(): CompassQualifier { * @return {Qualifiers.Compass.CompassQualifier} Compass */ function east(): CompassQualifier { - return new CompassQualifier('east'); + return new CompassQualifier("east"); } /** @@ -38,7 +37,7 @@ function east(): CompassQualifier { * @return {Qualifiers.Compass.CompassQualifier} Compass */ function west(): CompassQualifier { - return new CompassQualifier('west'); + return new CompassQualifier("west"); } /** @@ -48,7 +47,7 @@ function west(): CompassQualifier { * @return {Qualifiers.Compass.CompassQualifier} Compass */ function northWest(): CompassQualifier { - return new CompassQualifier('north_west'); + return new CompassQualifier("north_west"); } /** @@ -58,7 +57,7 @@ function northWest(): CompassQualifier { * @return {Qualifiers.Compass.CompassQualifier} Compass */ function northEast(): CompassQualifier { - return new CompassQualifier('north_east'); + return new CompassQualifier("north_east"); } /** @@ -68,7 +67,7 @@ function northEast(): CompassQualifier { * @return {Qualifiers.Compass.CompassQualifier} Compass */ function southWest(): CompassQualifier { - return new CompassQualifier('south_west'); + return new CompassQualifier("south_west"); } /** @@ -78,7 +77,7 @@ function southWest(): CompassQualifier { * @return {Qualifiers.Compass.CompassQualifier} Compass */ function southEast(): CompassQualifier { - return new CompassQualifier('south_east'); + return new CompassQualifier("south_east"); } /** @@ -88,12 +87,9 @@ function southEast(): CompassQualifier { * @return {Qualifiers.Compass.CompassQualifier} Compass */ function center(): CompassQualifier { - return new CompassQualifier('center'); + return new CompassQualifier("center"); } - - - /** * @description Defines the focal Compass for certain methods of cropping. * @namespace Compass @@ -104,24 +100,12 @@ class Compass { static north = north; static west = west; static east = east; - static south =south; - static center = center - static northWest =northWest - static southEast =southEast; + static south = south; + static center = center; + static northWest = northWest; + static southEast = southEast; static southWest = southWest; - static northEast =northEast; + static northEast = northEast; } - -export { - Compass, - north, - west, - east, - south, - center, - northWest, - southEast, - southWest, - northEast -}; +export { Compass, north, west, east, south, center, northWest, southEast, southWest, northEast }; diff --git a/src/qualifiers/concatenate.ts b/src/qualifiers/concatenate.ts index 9b2b902..06b5b2a 100644 --- a/src/qualifiers/concatenate.ts +++ b/src/qualifiers/concatenate.ts @@ -1,6 +1,6 @@ -import {VideoSource} from "./source/sourceTypes/VideoSource.js"; -import {ImageSource} from "./source/sourceTypes/ImageSource.js"; -import {FetchSource} from "./source/sourceTypes/FetchSource.js"; +import { VideoSource } from "./source/sourceTypes/VideoSource.js"; +import { ImageSource } from "./source/sourceTypes/ImageSource.js"; +import { FetchSource } from "./source/sourceTypes/FetchSource.js"; /** * @description This namespace contains different sources that can be used when concatenating to a video * @memberOf Qualifiers @@ -8,7 +8,6 @@ import {FetchSource} from "./source/sourceTypes/FetchSource.js"; * @see Visit {@link Actions.VideoEdit.concatenate|VideoEdit.concatenate} for an example */ - /** * @summary qualifier * @description Returns an instance of an ImageSource @@ -20,7 +19,6 @@ function imageSource(publicID: string): ImageSource { return new ImageSource(publicID); } - /** * @summary qualifier * @description Returns an instance of a VideoSource @@ -32,7 +30,6 @@ function videoSource(publicID: string): VideoSource { return new VideoSource(publicID); } - /** * @summary qualifier * @description Returns an instance of a FetchSource @@ -44,6 +41,5 @@ function fetchSource(remoteURL: string): FetchSource { return new FetchSource(remoteURL); } - -const Concatenate = {imageSource, videoSource, fetchSource}; -export {Concatenate, imageSource, videoSource, fetchSource}; +const Concatenate = { imageSource, videoSource, fetchSource }; +export { Concatenate, imageSource, videoSource, fetchSource }; diff --git a/src/qualifiers/dither.ts b/src/qualifiers/dither.ts index e59411f..36566cf 100644 --- a/src/qualifiers/dither.ts +++ b/src/qualifiers/dither.ts @@ -5,7 +5,6 @@ * @see Visit {@link Actions.Effect.dither|Dither Effect} for an example */ - /** * @summary qualifier * @memberOf Qualifiers.Dither @@ -158,7 +157,6 @@ function circles7x7White(): number { return 18; } - const Dither = { checkerboard2x1Dither, circles5x5Black, @@ -178,10 +176,9 @@ const Dither = { ordered3x3Dispersed, ordered4x4Dispersed, ordered8x8Dispersed, - threshold1x1Nondither + threshold1x1Nondither, }; - export { Dither, checkerboard2x1Dither, @@ -202,5 +199,5 @@ export { ordered3x3Dispersed, ordered4x4Dispersed, ordered8x8Dispersed, - threshold1x1Nondither + threshold1x1Nondither, }; diff --git a/src/qualifiers/dpr.ts b/src/qualifiers/dpr.ts index 5fd7ebc..fd33fe3 100644 --- a/src/qualifiers/dpr.ts +++ b/src/qualifiers/dpr.ts @@ -11,11 +11,11 @@ * @memberOf Qualifiers.DPR */ function auto(): string { - return 'auto'; + return "auto"; } const Dpr = { - auto + auto, }; -export {auto, Dpr}; +export { auto, Dpr }; diff --git a/src/qualifiers/expression.ts b/src/qualifiers/expression.ts index a614bdd..497f63b 100644 --- a/src/qualifiers/expression.ts +++ b/src/qualifiers/expression.ts @@ -1,6 +1,5 @@ -import {CONDITIONAL_OPERATORS, RESERVED_NAMES} from "../internal/internalConstants.js"; -import {ExpressionQualifier} from "./expression/ExpressionQualifier.js"; - +import { CONDITIONAL_OPERATORS, RESERVED_NAMES } from "../internal/internalConstants.js"; +import { ExpressionQualifier } from "./expression/ExpressionQualifier.js"; /** * @description @@ -10,7 +9,6 @@ import {ExpressionQualifier} from "./expression/ExpressionQualifier.js"; * @memberOf Qualifiers */ - /** * @summary qualifier * @memberOf Qualifiers.Expression @@ -23,27 +21,25 @@ function expression(exp: string): ExpressionQualifier { // $foo * $bar is replaced to $foo_mul_$bar // $foo*bar is treated AS-IS. const reservedOperatorList = Object.keys(CONDITIONAL_OPERATORS).map((key) => { - return `\\s${key.replace(/(\*|\+|\^|\|)/g, '\\$1')}\\s`; + return `\\s${key.replace(/(\*|\+|\^|\|)/g, "\\$1")}\\s`; }); // reservedOperatorList is now an array of values, joining with | creates the regex list - const regexSafeOperatorList = reservedOperatorList.join('|'); + const regexSafeOperatorList = reservedOperatorList.join("|"); const operatorsReplaceRE = new RegExp(`(${regexSafeOperatorList})`, "g"); // First, we replace all the operators // Notice how we pad the matched operators with `_`, this is following the step above. // This turns $foo * $bar into $foo_mul_$bar (notice how the spaces were replaced with an underscore - const stringWithOperators = exp.toString() - .replace(operatorsReplaceRE, (match: string) => { - // match contains spaces around the expression, we need to trim it as the original list - // does not contain spaces. - return `_${CONDITIONAL_OPERATORS[match.trim() as keyof typeof CONDITIONAL_OPERATORS]}_`; - }); - + const stringWithOperators = exp.toString().replace(operatorsReplaceRE, (match: string) => { + // match contains spaces around the expression, we need to trim it as the original list + // does not contain spaces. + return `_${CONDITIONAL_OPERATORS[match.trim() as keyof typeof CONDITIONAL_OPERATORS]}_`; + }); // Handle reserved names (width, height, etc.) const ReservedNames = Object.keys(RESERVED_NAMES); - const regexSafeReservedNameList = ReservedNames.join('|'); + const regexSafeReservedNameList = ReservedNames.join("|"); // Gather all statements that begin with a dollar sign, underscore or a space // Gather all RESERVED NAMES // $foo_bar is matched @@ -53,7 +49,7 @@ function expression(exp: string): ExpressionQualifier { // Since this regex captures both user variables and our reserved keywords, we need to add some logic in the replacer const stringWithVariables = stringWithOperators.replace(reservedNamesRE, (match) => { // Do not do anything to user variables (anything starting with $) - if (match.startsWith('$')) { + if (match.startsWith("$")) { return match; } else { return RESERVED_NAMES[match as keyof typeof RESERVED_NAMES] || match; @@ -61,17 +57,14 @@ function expression(exp: string): ExpressionQualifier { }); // Serialize remaining spaces with an underscore - const finalExpressionString = stringWithVariables.replace(/\s/g, '_'); + const finalExpressionString = stringWithVariables.replace(/\s/g, "_"); return new ExpressionQualifier(finalExpressionString); } // as a namespace const Expression = { - expression + expression, }; -export { - Expression, - expression -}; +export { Expression, expression }; diff --git a/src/qualifiers/expression/ExpressionQualifier.ts b/src/qualifiers/expression/ExpressionQualifier.ts index 1d59ad2..c767c7c 100644 --- a/src/qualifiers/expression/ExpressionQualifier.ts +++ b/src/qualifiers/expression/ExpressionQualifier.ts @@ -1,4 +1,4 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @namespace Expression @@ -18,4 +18,4 @@ class ExpressionQualifier extends QualifierValue { } } -export { ExpressionQualifier} ; +export { ExpressionQualifier }; diff --git a/src/qualifiers/flag.ts b/src/qualifiers/flag.ts index 0f8a50e..93b8fe5 100644 --- a/src/qualifiers/flag.ts +++ b/src/qualifiers/flag.ts @@ -4,8 +4,7 @@ * @memberOf Qualifiers */ -import {FlagQualifier} from "./flag/FlagQualifier.js"; - +import { FlagQualifier } from "./flag/FlagQualifier.js"; /** * @summary qualifier @@ -20,10 +19,9 @@ import {FlagQualifier} from "./flag/FlagQualifier.js"; * @return {Qualifiers.Flag.FlagQualifier} */ function animated(): FlagQualifier { - return new FlagQualifier('animated'); + return new FlagQualifier("animated"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -35,10 +33,9 @@ function animated(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function animatedWebP(): FlagQualifier { - return new FlagQualifier('awebp'); + return new FlagQualifier("awebp"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -47,10 +44,9 @@ function animatedWebP(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function anyFormat(): FlagQualifier { - return new FlagQualifier('any_format'); + return new FlagQualifier("any_format"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -62,10 +58,9 @@ function anyFormat(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function animatedPng(): FlagQualifier { - return new FlagQualifier('apng'); + return new FlagQualifier("apng"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -74,10 +69,9 @@ function animatedPng(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function clip(): FlagQualifier { - return new FlagQualifier('clip'); + return new FlagQualifier("clip"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -87,10 +81,9 @@ function clip(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function clipEvenOdd(): FlagQualifier { - return new FlagQualifier('clip_evenodd'); + return new FlagQualifier("clip_evenodd"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -99,10 +92,9 @@ function clipEvenOdd(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function forceStrip(): FlagQualifier { - return new FlagQualifier('force_strip'); + return new FlagQualifier("force_strip"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -113,7 +105,6 @@ function custom(value: string): FlagQualifier { return new FlagQualifier(value); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -121,10 +112,9 @@ function custom(value: string): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function forceIcc(): FlagQualifier { - return new FlagQualifier('force_icc'); + return new FlagQualifier("force_icc"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -133,10 +123,9 @@ function forceIcc(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function attachment(filename?: string): FlagQualifier { - return new FlagQualifier('attachment', filename); + return new FlagQualifier("attachment", filename); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -145,10 +134,9 @@ function attachment(filename?: string): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function getInfo(): FlagQualifier { - return new FlagQualifier('getinfo'); + return new FlagQualifier("getinfo"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -157,10 +145,9 @@ function getInfo(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function hlsv3(): FlagQualifier { - return new FlagQualifier('hlsv3'); + return new FlagQualifier("hlsv3"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -168,10 +155,9 @@ function hlsv3(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function immutableCache(): FlagQualifier { - return new FlagQualifier('immutable_cache'); + return new FlagQualifier("immutable_cache"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -180,10 +166,9 @@ function immutableCache(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function ignoreInitialAspectRatio(): FlagQualifier { - return new FlagQualifier('ignore_aspect_ratio'); + return new FlagQualifier("ignore_aspect_ratio"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -191,10 +176,9 @@ function ignoreInitialAspectRatio(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function keepAttribution(): FlagQualifier { - return new FlagQualifier('keep_attribution'); + return new FlagQualifier("keep_attribution"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -203,10 +187,9 @@ function keepAttribution(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function keepDar(): FlagQualifier { - return new FlagQualifier('keep_dar'); + return new FlagQualifier("keep_dar"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -214,10 +197,9 @@ function keepDar(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function keepIptc(): FlagQualifier { - return new FlagQualifier('keep_iptc'); + return new FlagQualifier("keep_iptc"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -226,10 +208,9 @@ function keepIptc(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function layerApply(): FlagQualifier { - return new FlagQualifier('layer_apply'); + return new FlagQualifier("layer_apply"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -241,10 +222,9 @@ function layerApply(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function lossy(): FlagQualifier { - return new FlagQualifier('lossy'); + return new FlagQualifier("lossy"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -252,10 +232,9 @@ function lossy(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function mono(): FlagQualifier { - return new FlagQualifier('mono'); + return new FlagQualifier("mono"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -265,10 +244,9 @@ function mono(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function noOverflow(): FlagQualifier { - return new FlagQualifier('no_overflow'); + return new FlagQualifier("no_overflow"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -276,10 +254,9 @@ function noOverflow(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function noStream(): FlagQualifier { - return new FlagQualifier('no_stream'); + return new FlagQualifier("no_stream"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -287,10 +264,9 @@ function noStream(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function png24(): FlagQualifier { - return new FlagQualifier('png24'); + return new FlagQualifier("png24"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -298,10 +274,9 @@ function png24(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function png32(): FlagQualifier { - return new FlagQualifier('png32'); + return new FlagQualifier("png32"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -309,10 +284,9 @@ function png32(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function png8(): FlagQualifier { - return new FlagQualifier('png8'); + return new FlagQualifier("png8"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -321,10 +295,9 @@ function png8(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function preserveTransparency(): FlagQualifier { - return new FlagQualifier('preserve_transparency'); + return new FlagQualifier("preserve_transparency"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -343,10 +316,9 @@ function preserveTransparency(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function progressive(mode?: FlagQualifier | string): FlagQualifier { - return new FlagQualifier('progressive', mode); + return new FlagQualifier("progressive", mode); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -354,10 +326,9 @@ function progressive(mode?: FlagQualifier | string): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function regionRelative(): FlagQualifier { - return new FlagQualifier('region_relative'); + return new FlagQualifier("region_relative"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -367,10 +338,9 @@ function regionRelative(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function rasterize(): FlagQualifier { - return new FlagQualifier('rasterize'); + return new FlagQualifier("rasterize"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -378,10 +348,9 @@ function rasterize(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function relative(): FlagQualifier { - return new FlagQualifier('relative'); + return new FlagQualifier("relative"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -389,10 +358,9 @@ function relative(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function sanitize(): FlagQualifier { - return new FlagQualifier('sanitize'); + return new FlagQualifier("sanitize"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -401,10 +369,9 @@ function sanitize(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function splice(): FlagQualifier { - return new FlagQualifier('splice'); + return new FlagQualifier("splice"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -412,10 +379,9 @@ function splice(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function stripProfile(): FlagQualifier { - return new FlagQualifier('strip_profile'); + return new FlagQualifier("strip_profile"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -434,10 +400,9 @@ function stripProfile(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function streamingAttachment(filename: string): FlagQualifier { - return new FlagQualifier('streaming_attachment', filename); + return new FlagQualifier("streaming_attachment", filename); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -445,10 +410,9 @@ function streamingAttachment(filename: string): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function tiff8Lzw(): FlagQualifier { - return new FlagQualifier('tiff8_lzw'); + return new FlagQualifier("tiff8_lzw"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -458,10 +422,9 @@ function tiff8Lzw(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function tiled(): FlagQualifier { - return new FlagQualifier('tiled'); + return new FlagQualifier("tiled"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -470,10 +433,9 @@ function tiled(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function truncateTS(): FlagQualifier { - return new FlagQualifier('truncate_ts'); + return new FlagQualifier("truncate_ts"); } - /** * @summary qualifier * @memberOf Qualifiers.Flag @@ -481,7 +443,7 @@ function truncateTS(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function waveform(): FlagQualifier { - return new FlagQualifier('waveform'); + return new FlagQualifier("waveform"); } /** @@ -491,26 +453,90 @@ function waveform(): FlagQualifier { * @return {Qualifiers.Flag.FlagQualifier} */ function ignoreMaskChannels(): FlagQualifier { - return new FlagQualifier('ignore_mask_channels'); + return new FlagQualifier("ignore_mask_channels"); } - const Flag = { - animated, anyFormat, animatedPng, animatedWebP, - clipEvenOdd, lossy, preserveTransparency, png8, png24, png32, progressive, rasterize, - sanitize, stripProfile, tiff8Lzw, attachment, forceIcc, forceStrip, getInfo, immutableCache, - keepAttribution, keepIptc, custom, streamingAttachment, hlsv3, keepDar, noStream, mono, - layerApply, relative, regionRelative, splice, truncateTS, waveform, ignoreInitialAspectRatio, clip, - tiled, noOverflow, ignoreMaskChannels + animated, + anyFormat, + animatedPng, + animatedWebP, + clipEvenOdd, + lossy, + preserveTransparency, + png8, + png24, + png32, + progressive, + rasterize, + sanitize, + stripProfile, + tiff8Lzw, + attachment, + forceIcc, + forceStrip, + getInfo, + immutableCache, + keepAttribution, + keepIptc, + custom, + streamingAttachment, + hlsv3, + keepDar, + noStream, + mono, + layerApply, + relative, + regionRelative, + splice, + truncateTS, + waveform, + ignoreInitialAspectRatio, + clip, + tiled, + noOverflow, + ignoreMaskChannels, }; export { - Flag, animated, anyFormat, animatedPng, animatedWebP, - clipEvenOdd, lossy, preserveTransparency, png8, png24, png32, progressive, rasterize, - sanitize, stripProfile, tiff8Lzw, attachment, forceIcc, forceStrip, getInfo, immutableCache, - keepAttribution, keepIptc, custom, streamingAttachment, hlsv3, keepDar, noStream, mono, - layerApply, relative, regionRelative, splice, truncateTS, waveform, ignoreInitialAspectRatio, clip, - tiled, noOverflow, ignoreMaskChannels + Flag, + animated, + anyFormat, + animatedPng, + animatedWebP, + clipEvenOdd, + lossy, + preserveTransparency, + png8, + png24, + png32, + progressive, + rasterize, + sanitize, + stripProfile, + tiff8Lzw, + attachment, + forceIcc, + forceStrip, + getInfo, + immutableCache, + keepAttribution, + keepIptc, + custom, + streamingAttachment, + hlsv3, + keepDar, + noStream, + mono, + layerApply, + relative, + regionRelative, + splice, + truncateTS, + waveform, + ignoreInitialAspectRatio, + clip, + tiled, + noOverflow, + ignoreMaskChannels, }; - - diff --git a/src/qualifiers/flag/FlagQualifier.ts b/src/qualifiers/flag/FlagQualifier.ts index c025d4c..30678c4 100644 --- a/src/qualifiers/flag/FlagQualifier.ts +++ b/src/qualifiers/flag/FlagQualifier.ts @@ -1,5 +1,5 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @memberOf Qualifiers.Flag @@ -7,25 +7,28 @@ import {Qualifier} from "../../internal/qualifier/Qualifier.js"; * @description the FlagQualifier class */ class FlagQualifier extends Qualifier { - flagValue : FlagQualifier | string; - constructor(flagType?: QualifierValue | QualifierValue[] | number | number[] | string | string[], flagValue?: FlagQualifier | string) { + flagValue: FlagQualifier | string; + constructor( + flagType?: QualifierValue | QualifierValue[] | number | number[] | string | string[], + flagValue?: FlagQualifier | string + ) { let qualifierValue; - if(flagValue) { - qualifierValue = new QualifierValue([flagType, `${flagValue}`]).setDelimiter(':'); - }else { + if (flagValue) { + qualifierValue = new QualifierValue([flagType, `${flagValue}`]).setDelimiter(":"); + } else { qualifierValue = flagType; } - super('fl', qualifierValue); + super("fl", qualifierValue); this.flagValue = flagValue; } toString(): string { - return super.toString().replace(/\./, '%2E'); + return super.toString().replace(/\./, "%2E"); } - getFlagValue(): string{ + getFlagValue(): string { return this.flagValue as string; } } -export {FlagQualifier}; +export { FlagQualifier }; diff --git a/src/qualifiers/focusOn.ts b/src/qualifiers/focusOn.ts index d62a6de..5f845dc 100644 --- a/src/qualifiers/focusOn.ts +++ b/src/qualifiers/focusOn.ts @@ -1,4 +1,4 @@ -import {FocusOnValue} from "./gravity/qualifiers/focusOn/FocusOnValue.js"; +import { FocusOnValue } from "./gravity/qualifiers/focusOn/FocusOnValue.js"; /** * @summary qualifier @@ -7,7 +7,7 @@ import {FocusOnValue} from "./gravity/qualifiers/focusOn/FocusOnValue.js"; * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function bird(): FocusOnValue { - return new FocusOnValue('bird'); + return new FocusOnValue("bird"); } /** @@ -16,7 +16,7 @@ function bird(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function dog(): FocusOnValue { - return new FocusOnValue('dog'); + return new FocusOnValue("dog"); } /** @@ -26,7 +26,7 @@ function dog(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function cat(): FocusOnValue { - return new FocusOnValue('cat'); + return new FocusOnValue("cat"); } /** @@ -36,7 +36,7 @@ function cat(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function microwave(): FocusOnValue { - return new FocusOnValue('microwave'); + return new FocusOnValue("microwave"); } /** @@ -46,7 +46,7 @@ function microwave(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function refrigerator(): FocusOnValue { - return new FocusOnValue('refrigerator'); + return new FocusOnValue("refrigerator"); } /** @@ -56,7 +56,7 @@ function refrigerator(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function bottle(): FocusOnValue { - return new FocusOnValue('bottle'); + return new FocusOnValue("bottle"); } /** @@ -66,7 +66,7 @@ function bottle(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function sink(): FocusOnValue { - return new FocusOnValue('sink'); + return new FocusOnValue("sink"); } /** @@ -76,7 +76,7 @@ function sink(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function skateboard(): FocusOnValue { - return new FocusOnValue('skateboard'); + return new FocusOnValue("skateboard"); } /** @@ -86,10 +86,9 @@ function skateboard(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function person(): FocusOnValue { - return new FocusOnValue('person'); + return new FocusOnValue("person"); } - /** * @summary qualifier * @memberOf Qualifiers.FocusOn @@ -97,7 +96,7 @@ function person(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function advancedFace(): FocusOnValue { - return new FocusOnValue('adv_face'); + return new FocusOnValue("adv_face"); } /** @@ -107,7 +106,7 @@ function advancedFace(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function advancedFaces(): FocusOnValue { - return new FocusOnValue('adv_faces'); + return new FocusOnValue("adv_faces"); } /** @@ -117,7 +116,7 @@ function advancedFaces(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function advancedEyes(): FocusOnValue { - return new FocusOnValue('adv_eyes'); + return new FocusOnValue("adv_eyes"); } /** @@ -127,7 +126,7 @@ function advancedEyes(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function face(): FocusOnValue { - return new FocusOnValue('face'); + return new FocusOnValue("face"); } /** @@ -137,7 +136,7 @@ function face(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function faces(): FocusOnValue { - return new FocusOnValue('faces'); + return new FocusOnValue("faces"); } /** @@ -147,7 +146,7 @@ function faces(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function background(): FocusOnValue { - return new FocusOnValue('background'); + return new FocusOnValue("background"); } /** @@ -157,7 +156,7 @@ function background(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function aeroplane(): FocusOnValue { - return new FocusOnValue('aeroplane'); + return new FocusOnValue("aeroplane"); } /** @@ -167,7 +166,7 @@ function aeroplane(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function bicycle(): FocusOnValue { - return new FocusOnValue('bicycle'); + return new FocusOnValue("bicycle"); } /** @@ -177,7 +176,7 @@ function bicycle(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function boat(): FocusOnValue { - return new FocusOnValue('boat'); + return new FocusOnValue("boat"); } /** @@ -187,7 +186,7 @@ function boat(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function bus(): FocusOnValue { - return new FocusOnValue('bus'); + return new FocusOnValue("bus"); } /** @@ -197,7 +196,7 @@ function bus(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function car(): FocusOnValue { - return new FocusOnValue('car'); + return new FocusOnValue("car"); } /** @@ -207,10 +206,9 @@ function car(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function chair(): FocusOnValue { - return new FocusOnValue('chair'); + return new FocusOnValue("chair"); } - /** * @summary qualifier * @memberOf Qualifiers.FocusOn @@ -218,7 +216,7 @@ function chair(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function cow(): FocusOnValue { - return new FocusOnValue('cow'); + return new FocusOnValue("cow"); } /** @@ -228,7 +226,7 @@ function cow(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function diningtable(): FocusOnValue { - return new FocusOnValue('diningtable'); + return new FocusOnValue("diningtable"); } /** @@ -238,7 +236,7 @@ function diningtable(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function horse(): FocusOnValue { - return new FocusOnValue('horse'); + return new FocusOnValue("horse"); } /** @@ -248,7 +246,7 @@ function horse(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function motorbike(): FocusOnValue { - return new FocusOnValue('motorbike'); + return new FocusOnValue("motorbike"); } /** @@ -258,7 +256,7 @@ function motorbike(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function pottedplant(): FocusOnValue { - return new FocusOnValue('pottedplant'); + return new FocusOnValue("pottedplant"); } /** @@ -268,7 +266,7 @@ function pottedplant(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function sheep(): FocusOnValue { - return new FocusOnValue('sheep'); + return new FocusOnValue("sheep"); } /** @@ -278,7 +276,7 @@ function sheep(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function sofa(): FocusOnValue { - return new FocusOnValue('sofa'); + return new FocusOnValue("sofa"); } /** @@ -288,7 +286,7 @@ function sofa(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function train(): FocusOnValue { - return new FocusOnValue('train'); + return new FocusOnValue("train"); } /** @@ -298,7 +296,7 @@ function train(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function tvmonitor(): FocusOnValue { - return new FocusOnValue('tvmonitor'); + return new FocusOnValue("tvmonitor"); } /** @@ -308,12 +306,9 @@ function tvmonitor(): FocusOnValue { * @return {Qualifiers.FocusOn.FocusOnValue} FocusOnValue */ function ocr(): FocusOnValue { - return new FocusOnValue('ocr_text'); + return new FocusOnValue("ocr_text"); } - - - /** * @memberOf Qualifiers * @namespace FocusOn @@ -350,10 +345,9 @@ const FocusOn = { diningtable, tvmonitor, motorbike, - ocr + ocr, }; - export { FocusOnValue, FocusOn, @@ -387,5 +381,5 @@ export { diningtable, tvmonitor, motorbike, - ocr + ocr, }; diff --git a/src/qualifiers/fontHinting.ts b/src/qualifiers/fontHinting.ts index 6cd30d7..f875b0f 100644 --- a/src/qualifiers/fontHinting.ts +++ b/src/qualifiers/fontHinting.ts @@ -7,13 +7,12 @@ * @see To be used with {@link Qualifiers.TextStyle|Text Style} */ - /** * @summary qualifier * @memberOf Qualifiers.FontHinting */ function none(): string { - return ''; + return ""; } /** @@ -21,7 +20,7 @@ function none(): string { * @memberOf Qualifiers.FontHinting */ function slight(): string { - return 'slight'; + return "slight"; } /** @@ -29,7 +28,7 @@ function slight(): string { * @memberOf Qualifiers.FontHinting */ function medium(): string { - return 'medium'; + return "medium"; } /** @@ -37,15 +36,9 @@ function medium(): string { * @memberOf Qualifiers.FontHinting */ function full(): string { - return 'full'; + return "full"; } -const FontHinting = {full, none, medium, slight}; +const FontHinting = { full, none, medium, slight }; -export { - FontHinting, - full, - none, - medium, - slight -}; +export { FontHinting, full, none, medium, slight }; diff --git a/src/qualifiers/fontStyle.ts b/src/qualifiers/fontStyle.ts index fefbd05..c09784a 100644 --- a/src/qualifiers/fontStyle.ts +++ b/src/qualifiers/fontStyle.ts @@ -12,7 +12,7 @@ * @memberOf Qualifiers.FontStyle */ function normal(): string { - return 'normal'; + return "normal"; } /** @@ -20,14 +20,9 @@ function normal(): string { * @memberOf Qualifiers.FontStyle */ function italic(): string { - return 'italic'; + return "italic"; } -const FontStyle = {normal, italic}; - -export { - FontStyle, - italic, - normal -}; +const FontStyle = { normal, italic }; +export { FontStyle, italic, normal }; diff --git a/src/qualifiers/fontWeight.ts b/src/qualifiers/fontWeight.ts index 653a46a..ef0b8a9 100644 --- a/src/qualifiers/fontWeight.ts +++ b/src/qualifiers/fontWeight.ts @@ -12,7 +12,7 @@ * @memberOf Qualifiers.FontWeight */ function thin(): string { - return 'thin'; + return "thin"; } /** @@ -20,7 +20,7 @@ function thin(): string { * @memberOf Qualifiers.FontWeight */ function light(): string { - return 'light'; + return "light"; } /** @@ -28,7 +28,7 @@ function light(): string { * @memberOf Qualifiers.FontWeight */ function normal(): string { - return 'normal'; + return "normal"; } /** @@ -36,15 +36,8 @@ function normal(): string { * @memberOf Qualifiers.FontWeight */ function bold(): string { - return 'bold'; + return "bold"; } - -const FontWeight = {bold, light, normal, thin}; -export { - FontWeight, - bold, - light, - normal, - thin -}; +const FontWeight = { bold, light, normal, thin }; +export { FontWeight, bold, light, normal, thin }; diff --git a/src/qualifiers/foregroundObject.ts b/src/qualifiers/foregroundObject.ts index b0c2b47..1d393cf 100644 --- a/src/qualifiers/foregroundObject.ts +++ b/src/qualifiers/foregroundObject.ts @@ -7,29 +7,29 @@ */ const ForegroundObject = { - AIRPLANE: 'airplane', - BUS: 'bus', - DINING_TABLE: 'dining_table', - SHEEP: 'sheep', - BICYCLE: 'bicycle', - CAR: 'car', - DOG: 'dog', - SOFA: 'sofa', - BIRD: 'bird', - CAT: 'cat', - HORSE: 'horse', - TRAIN: 'train', - BOAT: 'boat', - CHAIR: 'chair', - PERSON: 'person', - TV: 'tv', - BOTTLE: 'bottle', - COW: 'cow', - POTTED_PLANT: 'potted_plant', - MOTORBIKE: 'motorbike', + AIRPLANE: "airplane", + BUS: "bus", + DINING_TABLE: "dining_table", + SHEEP: "sheep", + BICYCLE: "bicycle", + CAR: "car", + DOG: "dog", + SOFA: "sofa", + BIRD: "bird", + CAT: "cat", + HORSE: "horse", + TRAIN: "train", + BOAT: "boat", + CHAIR: "chair", + PERSON: "person", + TV: "tv", + BOTTLE: "bottle", + COW: "cow", + POTTED_PLANT: "potted_plant", + MOTORBIKE: "motorbike", } as const; -export {ForegroundObject}; +export { ForegroundObject }; export type ForegroundObjectValue = typeof ForegroundObject[keyof typeof ForegroundObject]; /** diff --git a/src/qualifiers/format.ts b/src/qualifiers/format.ts index 1958890..c693d28 100644 --- a/src/qualifiers/format.ts +++ b/src/qualifiers/format.ts @@ -1,4 +1,4 @@ -import {FormatQualifier} from "./format/FormatQualifier.js"; +import { FormatQualifier } from "./format/FormatQualifier.js"; /** * @description Contains functions to select the asset format, can be used to convert images and videos to other formats. @@ -7,16 +7,15 @@ import {FormatQualifier} from "./format/FormatQualifier.js"; * @see Visit {@link Actions.Delivery.format|Delivery Format} for an example */ - - - /** * @summary qualifier * @description Image format heic. * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function heic():FormatQualifier { return new FormatQualifier('heic'); } +function heic(): FormatQualifier { + return new FormatQualifier("heic"); +} /** * @summary qualifier @@ -24,7 +23,9 @@ function heic():FormatQualifier { return new FormatQualifier('heic'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function flif():FormatQualifier { return new FormatQualifier('flif'); } +function flif(): FormatQualifier { + return new FormatQualifier("flif"); +} /** * @summary qualifier @@ -32,7 +33,9 @@ function flif():FormatQualifier { return new FormatQualifier('flif'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function ai():FormatQualifier { return new FormatQualifier('ai'); } +function ai(): FormatQualifier { + return new FormatQualifier("ai"); +} /** * @summary qualifier @@ -40,7 +43,9 @@ function ai():FormatQualifier { return new FormatQualifier('ai'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function wdp():FormatQualifier { return new FormatQualifier('wdp'); } +function wdp(): FormatQualifier { + return new FormatQualifier("wdp"); +} /** * @summary qualifier @@ -48,7 +53,9 @@ function wdp():FormatQualifier { return new FormatQualifier('wdp'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function svg():FormatQualifier { return new FormatQualifier('svg'); } +function svg(): FormatQualifier { + return new FormatQualifier("svg"); +} /** * @summary qualifier @@ -56,7 +63,9 @@ function svg():FormatQualifier { return new FormatQualifier('svg'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function webp():FormatQualifier { return new FormatQualifier('webp'); } +function webp(): FormatQualifier { + return new FormatQualifier("webp"); +} /** * @summary qualifier @@ -64,7 +73,9 @@ function webp():FormatQualifier { return new FormatQualifier('webp'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function psd():FormatQualifier { return new FormatQualifier('psd'); } +function psd(): FormatQualifier { + return new FormatQualifier("psd"); +} /** * @summary qualifier @@ -72,7 +83,9 @@ function psd():FormatQualifier { return new FormatQualifier('psd'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function jp2():FormatQualifier { return new FormatQualifier('jp2'); } +function jp2(): FormatQualifier { + return new FormatQualifier("jp2"); +} /** * @summary qualifier @@ -80,7 +93,9 @@ function jp2():FormatQualifier { return new FormatQualifier('jp2'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function jpc():FormatQualifier { return new FormatQualifier('jpc'); } +function jpc(): FormatQualifier { + return new FormatQualifier("jpc"); +} /** * @summary qualifier @@ -88,7 +103,9 @@ function jpc():FormatQualifier { return new FormatQualifier('jpc'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function eps():FormatQualifier { return new FormatQualifier('eps'); } +function eps(): FormatQualifier { + return new FormatQualifier("eps"); +} /** * @summary qualifier @@ -96,7 +113,9 @@ function eps():FormatQualifier { return new FormatQualifier('eps'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function tiff():FormatQualifier { return new FormatQualifier('tiff'); } +function tiff(): FormatQualifier { + return new FormatQualifier("tiff"); +} /** * @summary qualifier @@ -104,7 +123,9 @@ function tiff():FormatQualifier { return new FormatQualifier('tiff'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function pdf():FormatQualifier { return new FormatQualifier('pdf'); } +function pdf(): FormatQualifier { + return new FormatQualifier("pdf"); +} /** * @summary qualifier @@ -112,7 +133,9 @@ function pdf():FormatQualifier { return new FormatQualifier('pdf'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function ico():FormatQualifier { return new FormatQualifier('ico'); } +function ico(): FormatQualifier { + return new FormatQualifier("ico"); +} /** * @summary qualifier @@ -120,7 +143,9 @@ function ico():FormatQualifier { return new FormatQualifier('ico'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function bmp():FormatQualifier { return new FormatQualifier('bmp'); } +function bmp(): FormatQualifier { + return new FormatQualifier("bmp"); +} /** * @summary qualifier @@ -128,7 +153,9 @@ function bmp():FormatQualifier { return new FormatQualifier('bmp'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function png():FormatQualifier { return new FormatQualifier('png'); } +function png(): FormatQualifier { + return new FormatQualifier("png"); +} /** * @summary qualifier @@ -136,7 +163,9 @@ function png():FormatQualifier { return new FormatQualifier('png'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function gif():FormatQualifier { return new FormatQualifier('gif'); } +function gif(): FormatQualifier { + return new FormatQualifier("gif"); +} /** * @summary qualifier @@ -144,7 +173,9 @@ function gif():FormatQualifier { return new FormatQualifier('gif'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function auto():FormatQualifier { return new FormatQualifier('auto'); } +function auto(): FormatQualifier { + return new FormatQualifier("auto"); +} /** * @summary qualifier @@ -152,7 +183,9 @@ function auto():FormatQualifier { return new FormatQualifier('auto'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function jpg():FormatQualifier { return new FormatQualifier('jpg'); } +function jpg(): FormatQualifier { + return new FormatQualifier("jpg"); +} /** * @summary qualifier @@ -160,7 +193,9 @@ function jpg():FormatQualifier { return new FormatQualifier('jpg'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function djvu():FormatQualifier { return new FormatQualifier('djvu'); } +function djvu(): FormatQualifier { + return new FormatQualifier("djvu"); +} /** * @summary qualifier @@ -168,7 +203,9 @@ function djvu():FormatQualifier { return new FormatQualifier('djvu'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function ps():FormatQualifier { return new FormatQualifier('ps'); } +function ps(): FormatQualifier { + return new FormatQualifier("ps"); +} /** * @summary qualifier @@ -176,7 +213,9 @@ function ps():FormatQualifier { return new FormatQualifier('ps'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function ept():FormatQualifier { return new FormatQualifier('ept'); } +function ept(): FormatQualifier { + return new FormatQualifier("ept"); +} /** * @summary qualifier @@ -184,7 +223,9 @@ function ept():FormatQualifier { return new FormatQualifier('ept'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function eps3():FormatQualifier { return new FormatQualifier('eps3'); } +function eps3(): FormatQualifier { + return new FormatQualifier("eps3"); +} /** * @summary qualifier @@ -192,7 +233,9 @@ function eps3():FormatQualifier { return new FormatQualifier('eps3'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function fxb():FormatQualifier { return new FormatQualifier('fxb'); } +function fxb(): FormatQualifier { + return new FormatQualifier("fxb"); +} /** * @summary qualifier @@ -200,7 +243,9 @@ function fxb():FormatQualifier { return new FormatQualifier('fxb'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function gltf():FormatQualifier { return new FormatQualifier('gltf'); } +function gltf(): FormatQualifier { + return new FormatQualifier("gltf"); +} /** * @summary qualifier @@ -208,7 +253,9 @@ function gltf():FormatQualifier { return new FormatQualifier('gltf'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function heif():FormatQualifier { return new FormatQualifier('heif'); } +function heif(): FormatQualifier { + return new FormatQualifier("heif"); +} /** * @summary qualifier @@ -216,7 +263,9 @@ function heif():FormatQualifier { return new FormatQualifier('heif'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function indd():FormatQualifier { return new FormatQualifier('indd'); } +function indd(): FormatQualifier { + return new FormatQualifier("indd"); +} /** * @summary qualifier @@ -224,7 +273,9 @@ function indd():FormatQualifier { return new FormatQualifier('indd'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function jpe():FormatQualifier { return new FormatQualifier('jpe'); } +function jpe(): FormatQualifier { + return new FormatQualifier("jpe"); +} /** * @summary qualifier @@ -232,7 +283,9 @@ function jpe():FormatQualifier { return new FormatQualifier('jpe'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function jpeg():FormatQualifier { return new FormatQualifier('jpeg'); } +function jpeg(): FormatQualifier { + return new FormatQualifier("jpeg"); +} /** * @summary qualifier @@ -240,7 +293,9 @@ function jpeg():FormatQualifier { return new FormatQualifier('jpeg'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function jxr():FormatQualifier { return new FormatQualifier('jxr'); } +function jxr(): FormatQualifier { + return new FormatQualifier("jxr"); +} /** * @summary qualifier @@ -248,7 +303,9 @@ function jxr():FormatQualifier { return new FormatQualifier('jxr'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function hdp():FormatQualifier { return new FormatQualifier('hdp'); } +function hdp(): FormatQualifier { + return new FormatQualifier("hdp"); +} /** * @summary qualifier @@ -256,7 +313,9 @@ function hdp():FormatQualifier { return new FormatQualifier('hdp'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function spd():FormatQualifier { return new FormatQualifier('spd'); } +function spd(): FormatQualifier { + return new FormatQualifier("spd"); +} /** * @summary qualifier @@ -264,7 +323,9 @@ function spd():FormatQualifier { return new FormatQualifier('spd'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function arw():FormatQualifier { return new FormatQualifier('arw'); } +function arw(): FormatQualifier { + return new FormatQualifier("arw"); +} /** * @summary qualifier @@ -272,7 +333,9 @@ function arw():FormatQualifier { return new FormatQualifier('arw'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function cr2():FormatQualifier { return new FormatQualifier('cr2'); } +function cr2(): FormatQualifier { + return new FormatQualifier("cr2"); +} /** * @summary qualifier @@ -280,7 +343,9 @@ function cr2():FormatQualifier { return new FormatQualifier('cr2'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function tga():FormatQualifier { return new FormatQualifier('tga'); } +function tga(): FormatQualifier { + return new FormatQualifier("tga"); +} /** * @summary qualifier @@ -288,7 +353,9 @@ function tga():FormatQualifier { return new FormatQualifier('tga'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function tif():FormatQualifier { return new FormatQualifier('tif'); } +function tif(): FormatQualifier { + return new FormatQualifier("tif"); +} /** * @summary qualifier @@ -296,7 +363,9 @@ function tif():FormatQualifier { return new FormatQualifier('tif'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function avif():FormatQualifier { return new FormatQualifier('avif'); } +function avif(): FormatQualifier { + return new FormatQualifier("avif"); +} /** * @summary qualifier @@ -304,7 +373,9 @@ function avif():FormatQualifier { return new FormatQualifier('avif'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function usdz():FormatQualifier { return new FormatQualifier('usdz'); } +function usdz(): FormatQualifier { + return new FormatQualifier("usdz"); +} /** * @summary qualifier @@ -312,7 +383,9 @@ function usdz():FormatQualifier { return new FormatQualifier('usdz'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function video3g2():FormatQualifier { return new FormatQualifier('3g2'); } +function video3g2(): FormatQualifier { + return new FormatQualifier("3g2"); +} /** * @summary qualifier @@ -320,7 +393,9 @@ function video3g2():FormatQualifier { return new FormatQualifier('3g2'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function video3gp():FormatQualifier { return new FormatQualifier('3gp'); } +function video3gp(): FormatQualifier { + return new FormatQualifier("3gp"); +} /** * @summary qualifier @@ -328,7 +403,9 @@ function video3gp():FormatQualifier { return new FormatQualifier('3gp'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoAvi():FormatQualifier { return new FormatQualifier('avi'); } +function videoAvi(): FormatQualifier { + return new FormatQualifier("avi"); +} /** * @summary qualifier @@ -336,7 +413,9 @@ function videoAvi():FormatQualifier { return new FormatQualifier('avi'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoFlv():FormatQualifier { return new FormatQualifier('flv'); } +function videoFlv(): FormatQualifier { + return new FormatQualifier("flv"); +} /** * @summary qualifier @@ -344,7 +423,9 @@ function videoFlv():FormatQualifier { return new FormatQualifier('flv'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoM3u8():FormatQualifier { return new FormatQualifier('m3u8'); } +function videoM3u8(): FormatQualifier { + return new FormatQualifier("m3u8"); +} /** * @summary qualifier @@ -352,7 +433,9 @@ function videoM3u8():FormatQualifier { return new FormatQualifier('m3u8'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoTs():FormatQualifier { return new FormatQualifier('ts'); } +function videoTs(): FormatQualifier { + return new FormatQualifier("ts"); +} /** * @summary qualifier @@ -360,7 +443,9 @@ function videoTs():FormatQualifier { return new FormatQualifier('ts'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoMov():FormatQualifier { return new FormatQualifier('mov'); } +function videoMov(): FormatQualifier { + return new FormatQualifier("mov"); +} /** * @summary qualifier @@ -368,7 +453,9 @@ function videoMov():FormatQualifier { return new FormatQualifier('mov'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoMkv():FormatQualifier { return new FormatQualifier('mkv'); } +function videoMkv(): FormatQualifier { + return new FormatQualifier("mkv"); +} /** * @summary qualifier @@ -376,7 +463,9 @@ function videoMkv():FormatQualifier { return new FormatQualifier('mkv'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoMp4():FormatQualifier { return new FormatQualifier('mp4'); } +function videoMp4(): FormatQualifier { + return new FormatQualifier("mp4"); +} /** * @summary qualifier @@ -384,7 +473,9 @@ function videoMp4():FormatQualifier { return new FormatQualifier('mp4'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoMpeg():FormatQualifier { return new FormatQualifier('mpeg'); } +function videoMpeg(): FormatQualifier { + return new FormatQualifier("mpeg"); +} /** * @summary qualifier @@ -392,7 +483,9 @@ function videoMpeg():FormatQualifier { return new FormatQualifier('mpeg'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoMpd():FormatQualifier { return new FormatQualifier('mpd'); } +function videoMpd(): FormatQualifier { + return new FormatQualifier("mpd"); +} /** * @summary qualifier @@ -400,7 +493,9 @@ function videoMpd():FormatQualifier { return new FormatQualifier('mpd'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoMxf():FormatQualifier { return new FormatQualifier('mxf'); } +function videoMxf(): FormatQualifier { + return new FormatQualifier("mxf"); +} /** * @summary qualifier @@ -408,7 +503,9 @@ function videoMxf():FormatQualifier { return new FormatQualifier('mxf'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoOgv():FormatQualifier { return new FormatQualifier('ogv'); } +function videoOgv(): FormatQualifier { + return new FormatQualifier("ogv"); +} /** * @summary qualifier @@ -416,7 +513,9 @@ function videoOgv():FormatQualifier { return new FormatQualifier('ogv'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoWebm():FormatQualifier { return new FormatQualifier('webm'); } +function videoWebm(): FormatQualifier { + return new FormatQualifier("webm"); +} /** * @summary qualifier @@ -424,7 +523,9 @@ function videoWebm():FormatQualifier { return new FormatQualifier('webm'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoWmv():FormatQualifier { return new FormatQualifier('wmv'); } +function videoWmv(): FormatQualifier { + return new FormatQualifier("wmv"); +} /** * @summary qualifier @@ -432,7 +533,9 @@ function videoWmv():FormatQualifier { return new FormatQualifier('wmv'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoM2ts():FormatQualifier { return new FormatQualifier('m2ts'); } +function videoM2ts(): FormatQualifier { + return new FormatQualifier("m2ts"); +} /** * @summary qualifier @@ -440,7 +543,9 @@ function videoM2ts():FormatQualifier { return new FormatQualifier('m2ts'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function videoMts():FormatQualifier { return new FormatQualifier('mts'); } +function videoMts(): FormatQualifier { + return new FormatQualifier("mts"); +} /** * @summary qualifier @@ -448,7 +553,9 @@ function videoMts():FormatQualifier { return new FormatQualifier('mts'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioAac():FormatQualifier { return new FormatQualifier('aac'); } +function audioAac(): FormatQualifier { + return new FormatQualifier("aac"); +} /** * @summary qualifier @@ -456,7 +563,9 @@ function audioAac():FormatQualifier { return new FormatQualifier('aac'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioAiff():FormatQualifier { return new FormatQualifier('aiff'); } +function audioAiff(): FormatQualifier { + return new FormatQualifier("aiff"); +} /** * @summary qualifier @@ -464,7 +573,9 @@ function audioAiff():FormatQualifier { return new FormatQualifier('aiff'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioAmr():FormatQualifier { return new FormatQualifier('amr'); } +function audioAmr(): FormatQualifier { + return new FormatQualifier("amr"); +} /** * @summary qualifier @@ -472,7 +583,9 @@ function audioAmr():FormatQualifier { return new FormatQualifier('amr'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioFlac():FormatQualifier { return new FormatQualifier('flac'); } +function audioFlac(): FormatQualifier { + return new FormatQualifier("flac"); +} /** * @summary qualifier @@ -480,7 +593,9 @@ function audioFlac():FormatQualifier { return new FormatQualifier('flac'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioM4a():FormatQualifier { return new FormatQualifier('m4a'); } +function audioM4a(): FormatQualifier { + return new FormatQualifier("m4a"); +} /** * @summary qualifier @@ -488,7 +603,9 @@ function audioM4a():FormatQualifier { return new FormatQualifier('m4a'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioMp3():FormatQualifier { return new FormatQualifier('mp3'); } +function audioMp3(): FormatQualifier { + return new FormatQualifier("mp3"); +} /** * @summary qualifier @@ -496,7 +613,9 @@ function audioMp3():FormatQualifier { return new FormatQualifier('mp3'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioOgg():FormatQualifier { return new FormatQualifier('ogg'); } +function audioOgg(): FormatQualifier { + return new FormatQualifier("ogg"); +} /** * @summary qualifier @@ -504,7 +623,9 @@ function audioOgg():FormatQualifier { return new FormatQualifier('ogg'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioOpus():FormatQualifier { return new FormatQualifier('opus'); } +function audioOpus(): FormatQualifier { + return new FormatQualifier("opus"); +} /** * @summary qualifier @@ -512,7 +633,9 @@ function audioOpus():FormatQualifier { return new FormatQualifier('opus'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function audioWav():FormatQualifier { return new FormatQualifier('wav'); } +function audioWav(): FormatQualifier { + return new FormatQualifier("wav"); +} /** * @summary qualifier @@ -520,8 +643,140 @@ function audioWav():FormatQualifier { return new FormatQualifier('wav'); } * @memberOf Qualifiers.Format * @return {Qualifiers.Format.FormatQualifier} */ -function glb():FormatQualifier { return new FormatQualifier('glb'); } - - -const Format = {usdz, jp2, ai, auto, bmp, eps, flif, gif, heic, ico, jpc, jpg, pdf, png, psd, svg, tiff, wdp, webp, arw, audioAac, audioAiff, audioAmr, audioFlac, audioM4a, audioMp3, audioOgg, audioOpus, audioWav, avif, cr2, djvu, eps3, ept, fxb, gltf, hdp, heif, indd, jpe, jpeg, jxr, ps, spd, tga, tif, video3g2, video3gp, videoAvi, videoFlv, videoM2ts, videoM3u8, videoMkv, videoMov, videoMp4, videoMpd, videoMpeg, videoMts, videoMxf, videoOgv, videoTs, videoWebm, videoWmv, glb}; -export {usdz, jp2, ai, auto, bmp, eps, flif, gif, heic, ico, jpc, jpg, pdf, png, psd, svg, tiff, wdp, webp, arw, audioAac, audioAiff, audioAmr, audioFlac, audioM4a, audioMp3, audioOgg, audioOpus, audioWav, avif, cr2, djvu, eps3, ept, fxb, gltf, hdp, heif, indd, jpe, jpeg, jxr, ps, spd, tga, tif, video3g2, video3gp, videoAvi, videoFlv, videoM2ts, videoM3u8, videoMkv, videoMov, videoMp4, videoMpd, videoMpeg, videoMts, videoMxf, videoOgv, videoTs, videoWebm, videoWmv, glb, Format}; +function glb(): FormatQualifier { + return new FormatQualifier("glb"); +} + +const Format = { + usdz, + jp2, + ai, + auto, + bmp, + eps, + flif, + gif, + heic, + ico, + jpc, + jpg, + pdf, + png, + psd, + svg, + tiff, + wdp, + webp, + arw, + audioAac, + audioAiff, + audioAmr, + audioFlac, + audioM4a, + audioMp3, + audioOgg, + audioOpus, + audioWav, + avif, + cr2, + djvu, + eps3, + ept, + fxb, + gltf, + hdp, + heif, + indd, + jpe, + jpeg, + jxr, + ps, + spd, + tga, + tif, + video3g2, + video3gp, + videoAvi, + videoFlv, + videoM2ts, + videoM3u8, + videoMkv, + videoMov, + videoMp4, + videoMpd, + videoMpeg, + videoMts, + videoMxf, + videoOgv, + videoTs, + videoWebm, + videoWmv, + glb, +}; +export { + usdz, + jp2, + ai, + auto, + bmp, + eps, + flif, + gif, + heic, + ico, + jpc, + jpg, + pdf, + png, + psd, + svg, + tiff, + wdp, + webp, + arw, + audioAac, + audioAiff, + audioAmr, + audioFlac, + audioM4a, + audioMp3, + audioOgg, + audioOpus, + audioWav, + avif, + cr2, + djvu, + eps3, + ept, + fxb, + gltf, + hdp, + heif, + indd, + jpe, + jpeg, + jxr, + ps, + spd, + tga, + tif, + video3g2, + video3gp, + videoAvi, + videoFlv, + videoM2ts, + videoM3u8, + videoMkv, + videoMov, + videoMp4, + videoMpd, + videoMpeg, + videoMts, + videoMxf, + videoOgv, + videoTs, + videoWebm, + videoWmv, + glb, + Format, +}; diff --git a/src/qualifiers/format/FormatQualifier.ts b/src/qualifiers/format/FormatQualifier.ts index fd11cea..8575e5a 100644 --- a/src/qualifiers/format/FormatQualifier.ts +++ b/src/qualifiers/format/FormatQualifier.ts @@ -1,4 +1,4 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @memberOf Qualifiers.Format @@ -11,9 +11,9 @@ class FormatQualifier extends QualifierValue { this.val = val; } - getValue(): string{ + getValue(): string { return this.val; } } -export {FormatQualifier}; +export { FormatQualifier }; diff --git a/src/qualifiers/gradientDirection.ts b/src/qualifiers/gradientDirection.ts index 3b91c6b..1f2b9cf 100644 --- a/src/qualifiers/gradientDirection.ts +++ b/src/qualifiers/gradientDirection.ts @@ -1,4 +1,4 @@ -import {GradientDirectionQualifierValue} from "./gradientDirection/GradientDirectionQualifierValue.js"; +import { GradientDirectionQualifierValue } from "./gradientDirection/GradientDirectionQualifierValue.js"; /** * @description Defines the direction for a background gradient fade effect. @@ -13,7 +13,7 @@ import {GradientDirectionQualifierValue} from "./gradientDirection/GradientDirec * @return {Qualifiers.GradientDirection.GradientDirectionQualifierValue} */ function horizontal(): GradientDirectionQualifierValue { - return new GradientDirectionQualifierValue('horizontal'); + return new GradientDirectionQualifierValue("horizontal"); } /** @@ -23,7 +23,7 @@ function horizontal(): GradientDirectionQualifierValue { * @return {Qualifiers.GradientDirection.GradientDirectionQualifierValue} */ function vertical(): GradientDirectionQualifierValue { - return new GradientDirectionQualifierValue('vertical'); + return new GradientDirectionQualifierValue("vertical"); } /** @@ -33,7 +33,7 @@ function vertical(): GradientDirectionQualifierValue { * @return {Qualifiers.GradientDirection.GradientDirectionQualifierValue} */ function diagonalDesc(): GradientDirectionQualifierValue { - return new GradientDirectionQualifierValue('diagonal_desc'); + return new GradientDirectionQualifierValue("diagonal_desc"); } /** @@ -43,23 +43,14 @@ function diagonalDesc(): GradientDirectionQualifierValue { * @return {Qualifiers.GradientDirection.GradientDirectionQualifierValue} */ function diagonalAsc(): GradientDirectionQualifierValue { - return new GradientDirectionQualifierValue('diagonal_asc'); + return new GradientDirectionQualifierValue("diagonal_asc"); } - - const GradientDirection = { - horizontal, - vertical, - diagonalDesc, - diagonalAsc -}; - - -export { horizontal, vertical, diagonalDesc, diagonalAsc, - GradientDirection }; + +export { horizontal, vertical, diagonalDesc, diagonalAsc, GradientDirection }; diff --git a/src/qualifiers/gradientDirection/GradientDirectionQualifierValue.ts b/src/qualifiers/gradientDirection/GradientDirectionQualifierValue.ts index 524d9d1..e2ac554 100644 --- a/src/qualifiers/gradientDirection/GradientDirectionQualifierValue.ts +++ b/src/qualifiers/gradientDirection/GradientDirectionQualifierValue.ts @@ -1,11 +1,9 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @memberOf Qualifiers.GradientDirection * @extends {SDK.QualifierValue} */ -class GradientDirectionQualifierValue extends QualifierValue { +class GradientDirectionQualifierValue extends QualifierValue {} -} - -export {GradientDirectionQualifierValue}; +export { GradientDirectionQualifierValue }; diff --git a/src/qualifiers/gravity.ts b/src/qualifiers/gravity.ts index aa3adf4..090733d 100644 --- a/src/qualifiers/gravity.ts +++ b/src/qualifiers/gravity.ts @@ -1,10 +1,9 @@ -import {FocusOnValue} from "./focusOn.js"; -import {CompassGravity} from "./gravity/compassGravity/CompassGravity.js"; -import {FocusOnGravity} from "./gravity/focusOnGravity/FocusOnGravity.js"; -import {AutoGravity} from "./gravity/autoGravity/AutoGravity.js"; -import {CompassQualifier} from "./gravity/qualifiers/compass/CompassQualifier.js"; -import {XYCenterGravity} from "./gravity/xyCenterGravity/XYCenterGravity.js"; - +import { FocusOnValue } from "./focusOn.js"; +import { CompassGravity } from "./gravity/compassGravity/CompassGravity.js"; +import { FocusOnGravity } from "./gravity/focusOnGravity/FocusOnGravity.js"; +import { AutoGravity } from "./gravity/autoGravity/AutoGravity.js"; +import { CompassQualifier } from "./gravity/qualifiers/compass/CompassQualifier.js"; +import { XYCenterGravity } from "./gravity/xyCenterGravity/XYCenterGravity.js"; /** * @description Defines the gravity based on directional values from a compass. @@ -44,7 +43,6 @@ function compass(direction: CompassQualifier | string): CompassGravity { * @return {FocusOnGravity} */ function focusOn(...args: FocusOnValue[]): FocusOnGravity { - const res = [...args]; return new FocusOnGravity(res); } @@ -77,7 +75,6 @@ function autoGravity(): AutoGravity { return new AutoGravity(); } - /** * @summary qualifier * @description Set the center of gravity to the given x & y coordinates. @@ -88,7 +85,6 @@ function xyCenter(): XYCenterGravity { return new XYCenterGravity(); } - /** * @description A qualifier that determines which part of an asset to focus on, and thus which part of the asset to keep,
      * when any part of the asset is cropped. For overlays, this setting determines where to place the overlay. @@ -110,13 +106,7 @@ const Gravity = { compass: compass, autoGravity: autoGravity, focusOn: focusOn, - xyCenter + xyCenter, }; -export { - Gravity, - compass, - autoGravity, - focusOn, - xyCenter -}; +export { Gravity, compass, autoGravity, focusOn, xyCenter }; diff --git a/src/qualifiers/gravity/GravityQualifier.ts b/src/qualifiers/gravity/GravityQualifier.ts index 046fa3b..ef2d79b 100644 --- a/src/qualifiers/gravity/GravityQualifier.ts +++ b/src/qualifiers/gravity/GravityQualifier.ts @@ -1,14 +1,14 @@ -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; -import {CompassGravity, ICompassGravity} from "./compassGravity/CompassGravity.js"; -import {AutoGravity} from "./autoGravity/AutoGravity.js"; -import {FocusOnGravity} from "./focusOnGravity/FocusOnGravity.js"; -import {FocusOnValue} from "../focusOn.js"; -import {AutoFocus} from "../autoFocus.js"; -import {CompassQualifier} from "./qualifiers/compass/CompassQualifier.js"; -import {XYCenterGravity} from "./xyCenterGravity/XYCenterGravity.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; +import { CompassGravity, ICompassGravity } from "./compassGravity/CompassGravity.js"; +import { AutoGravity } from "./autoGravity/AutoGravity.js"; +import { FocusOnGravity } from "./focusOnGravity/FocusOnGravity.js"; +import { FocusOnValue } from "../focusOn.js"; +import { AutoFocus } from "../autoFocus.js"; +import { CompassQualifier } from "./qualifiers/compass/CompassQualifier.js"; +import { XYCenterGravity } from "./xyCenterGravity/XYCenterGravity.js"; -export type IGravityString = 'auto' | ICompassGravity; +export type IGravityString = "auto" | ICompassGravity; export type IGravity = CompassGravity | AutoGravity | FocusOnGravity | XYCenterGravity | IGravityString | string; export type IGravityValue = CompassQualifier | FocusOnValue | AutoFocus; @@ -21,8 +21,8 @@ class GravityQualifier extends Qualifier { * @param value, an array containing (GravityObject | AutoGravity | string) or a string; */ constructor(value: IGravityValue | IGravityValue[] | string) { - super('g', new QualifierValue(value)); + super("g", new QualifierValue(value)); } } -export {GravityQualifier}; +export { GravityQualifier }; diff --git a/src/qualifiers/gravity/autoGravity/AutoGravity.ts b/src/qualifiers/gravity/autoGravity/AutoGravity.ts index 2b9b7da..1fad2fd 100644 --- a/src/qualifiers/gravity/autoGravity/AutoGravity.ts +++ b/src/qualifiers/gravity/autoGravity/AutoGravity.ts @@ -1,5 +1,5 @@ -import {AutoFocus} from "../../autoFocus.js"; -import {GravityQualifier} from "../GravityQualifier.js"; +import { AutoFocus } from "../../autoFocus.js"; +import { GravityQualifier } from "../GravityQualifier.js"; /** * @description The class for the autoGravity builder @@ -10,7 +10,7 @@ class AutoGravity extends GravityQualifier { constructor() { // Required due to https://github.com/microsoft/TypeScript/issues/13029 /* istanbul ignore next */ - super('auto'); + super("auto"); } /** @@ -23,5 +23,4 @@ class AutoGravity extends GravityQualifier { } } - -export {AutoGravity}; +export { AutoGravity }; diff --git a/src/qualifiers/gravity/compassGravity/CompassGravity.ts b/src/qualifiers/gravity/compassGravity/CompassGravity.ts index 5955f14..dee4507 100644 --- a/src/qualifiers/gravity/compassGravity/CompassGravity.ts +++ b/src/qualifiers/gravity/compassGravity/CompassGravity.ts @@ -1,7 +1,16 @@ -import {GravityQualifier} from "../GravityQualifier.js"; -import {CompassQualifier} from "../qualifiers/compass/CompassQualifier.js"; +import { GravityQualifier } from "../GravityQualifier.js"; +import { CompassQualifier } from "../qualifiers/compass/CompassQualifier.js"; -type ICompassGravity = 'north' | 'center' | 'east' | 'west' | 'south' | 'north_west' | 'south_east' | 'south_west' | 'north_east'; +type ICompassGravity = + | "north" + | "center" + | "east" + | "west" + | "south" + | "north_west" + | "south_east" + | "south_west" + | "north_east"; /** * @description The class for the CompassGravity builder @@ -9,7 +18,7 @@ type ICompassGravity = 'north' | 'center' | 'east' | 'west' | 'south' | 'north_w * @extends {Qualifiers.Gravity.GravityQualifier} */ class CompassGravity extends GravityQualifier { - private type:'gravity'; + private type: "gravity"; constructor(dir: CompassQualifier | string) { // Required due to https://github.com/microsoft/TypeScript/issues/13029 /* istanbul ignore next */ @@ -17,4 +26,4 @@ class CompassGravity extends GravityQualifier { } } -export {CompassGravity, ICompassGravity}; +export { CompassGravity, ICompassGravity }; diff --git a/src/qualifiers/gravity/focusOnGravity/FocusOnGravity.ts b/src/qualifiers/gravity/focusOnGravity/FocusOnGravity.ts index e4635e9..5d129ea 100644 --- a/src/qualifiers/gravity/focusOnGravity/FocusOnGravity.ts +++ b/src/qualifiers/gravity/focusOnGravity/FocusOnGravity.ts @@ -1,6 +1,6 @@ -import {FocusOnValue} from "../../focusOn.js"; -import {GravityQualifier} from "../GravityQualifier.js"; -import {AutoGravity} from "../autoGravity/AutoGravity.js"; +import { FocusOnValue } from "../../focusOn.js"; +import { GravityQualifier } from "../GravityQualifier.js"; +import { AutoGravity } from "../autoGravity/AutoGravity.js"; /** * @description The class for the FocusOn builder @@ -30,4 +30,4 @@ class FocusOnGravity extends GravityQualifier { } } -export {FocusOnGravity}; +export { FocusOnGravity }; diff --git a/src/qualifiers/gravity/qualifiers/compass/CompassQualifier.ts b/src/qualifiers/gravity/qualifiers/compass/CompassQualifier.ts index 617d000..903fa10 100644 --- a/src/qualifiers/gravity/qualifiers/compass/CompassQualifier.ts +++ b/src/qualifiers/gravity/qualifiers/compass/CompassQualifier.ts @@ -1,4 +1,4 @@ -import {QualifierValue} from "../../../../internal/qualifier/QualifierValue.js"; +import { QualifierValue } from "../../../../internal/qualifier/QualifierValue.js"; /** * @memberOf Qualifiers.Compass @@ -6,7 +6,7 @@ import {QualifierValue} from "../../../../internal/qualifier/QualifierValue.js"; */ class CompassQualifier extends QualifierValue { // Creates a unique type of TypeScript so it can distinguish between QualifierValue and Compass - private type: 'Compass' + private type: "Compass"; readonly val: string; constructor(val: string) { @@ -19,4 +19,4 @@ class CompassQualifier extends QualifierValue { } } -export {CompassQualifier}; +export { CompassQualifier }; diff --git a/src/qualifiers/gravity/qualifiers/focusOn/FocusOnValue.ts b/src/qualifiers/gravity/qualifiers/focusOn/FocusOnValue.ts index 8e6ba97..a329506 100644 --- a/src/qualifiers/gravity/qualifiers/focusOn/FocusOnValue.ts +++ b/src/qualifiers/gravity/qualifiers/focusOn/FocusOnValue.ts @@ -1,4 +1,4 @@ -import {QualifierValue} from "../../../../internal/qualifier/QualifierValue.js"; +import { QualifierValue } from "../../../../internal/qualifier/QualifierValue.js"; /** * @memberOf Qualifiers.FocusOn @@ -17,5 +17,4 @@ class FocusOnValue extends QualifierValue { } } - -export {FocusOnValue}; +export { FocusOnValue }; diff --git a/src/qualifiers/gravity/xyCenterGravity/XYCenterGravity.ts b/src/qualifiers/gravity/xyCenterGravity/XYCenterGravity.ts index 410be07..aee884a 100644 --- a/src/qualifiers/gravity/xyCenterGravity/XYCenterGravity.ts +++ b/src/qualifiers/gravity/xyCenterGravity/XYCenterGravity.ts @@ -1,4 +1,4 @@ -import {GravityQualifier} from "../GravityQualifier.js"; +import { GravityQualifier } from "../GravityQualifier.js"; /** * @description The class for the XYCenter Gravity builder @@ -9,9 +9,8 @@ class XYCenterGravity extends GravityQualifier { constructor() { // Required due to https://github.com/microsoft/TypeScript/issues/13029 /* istanbul ignore next */ - super('xy_center'); + super("xy_center"); } } - -export {XYCenterGravity}; +export { XYCenterGravity }; diff --git a/src/qualifiers/improveMode.ts b/src/qualifiers/improveMode.ts index 99fd817..aff98db 100644 --- a/src/qualifiers/improveMode.ts +++ b/src/qualifiers/improveMode.ts @@ -1,4 +1,3 @@ - /** * @description Defines the available modes to use with the improve effect. * @namespace ImproveMode @@ -14,8 +13,6 @@ * image.adjust(improve().mode(outdoor())); */ - - /** * @summary qualifier * @memberOf Qualifiers.ImproveMode @@ -23,7 +20,7 @@ * @return string */ function outdoor(): string { - return 'outdoor'; + return "outdoor"; } /** @@ -33,13 +30,12 @@ function outdoor(): string { * @return string */ function indoor(): string { - return 'indoor'; + return "indoor"; } const ImproveMode = { indoor, - outdoor + outdoor, }; -export {outdoor, indoor, ImproveMode}; - +export { outdoor, indoor, ImproveMode }; diff --git a/src/qualifiers/outlineMode.ts b/src/qualifiers/outlineMode.ts index c356848..5f0ec6a 100644 --- a/src/qualifiers/outlineMode.ts +++ b/src/qualifiers/outlineMode.ts @@ -10,7 +10,7 @@ * @memberOf Qualifiers.Outline */ function fill(): string { - return 'fill'; + return "fill"; } /** @@ -18,7 +18,7 @@ function fill(): string { * @memberOf Qualifiers.Outline */ function inner(): string { - return 'inner'; + return "inner"; } /** @@ -26,7 +26,7 @@ function inner(): string { * @memberOf Qualifiers.Outline */ function innerFill(): string { - return 'inner_fill'; + return "inner_fill"; } /** @@ -34,20 +34,14 @@ function innerFill(): string { * @memberOf Qualifiers.Outline */ function outer(): string { - return 'outer'; + return "outer"; } const OutlineMode = { outer, inner, innerFill, - fill + fill, }; -export { - OutlineMode, - outer, - inner, - innerFill, - fill -}; +export { OutlineMode, outer, inner, innerFill, fill }; diff --git a/src/qualifiers/position.ts b/src/qualifiers/position.ts index 5a5cf1b..1e5b95e 100644 --- a/src/qualifiers/position.ts +++ b/src/qualifiers/position.ts @@ -1,4 +1,4 @@ -import {PositionQualifier} from "./position/PositionQualifier.js"; +import { PositionQualifier } from "./position/PositionQualifier.js"; /** * @description * Defines the position of a layer: overlay or underlay.
      @@ -10,7 +10,4 @@ import {PositionQualifier} from "./position/PositionQualifier.js"; * @see {@link Actions.Underlay| The underlay action} * */ -export { - PositionQualifier as Position -}; - +export { PositionQualifier as Position }; diff --git a/src/qualifiers/position/PositionQualifier.ts b/src/qualifiers/position/PositionQualifier.ts index edb9564..f75258a 100644 --- a/src/qualifiers/position/PositionQualifier.ts +++ b/src/qualifiers/position/PositionQualifier.ts @@ -1,11 +1,11 @@ -import {Action} from "../../internal/Action.js"; -import {CompassGravity} from "../gravity/compassGravity/CompassGravity.js"; -import {FocusOnGravity} from "../gravity/focusOnGravity/FocusOnGravity.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; -import {tiled} from "../flag.js"; -import {noOverflow} from "../flag.js"; -import {IPositionModel} from "../../internal/models/IPositionModel.js"; -import {createGravityModel} from "../../internal/models/createGravityModel.js"; +import { Action } from "../../internal/Action.js"; +import { CompassGravity } from "../gravity/compassGravity/CompassGravity.js"; +import { FocusOnGravity } from "../gravity/focusOnGravity/FocusOnGravity.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; +import { tiled } from "../flag.js"; +import { noOverflow } from "../flag.js"; +import { IPositionModel } from "../../internal/models/IPositionModel.js"; +import { createGravityModel } from "../../internal/models/createGravityModel.js"; /** * @description @@ -63,8 +63,8 @@ class PositionQualifier extends Action { * @param {number | string} offsetX * @return {this} */ - offsetX(offsetX:number | string): this{ - this.addQualifier(new Qualifier('x', offsetX)); + offsetX(offsetX: number | string): this { + this.addQualifier(new Qualifier("x", offsetX)); this._actionModel.offsetX = offsetX; return this; @@ -75,12 +75,12 @@ class PositionQualifier extends Action { * @param {number | string} offsetY * @return {this} */ - offsetY(offsetY:number | string): this{ - this.addQualifier(new Qualifier('y', offsetY)); + offsetY(offsetY: number | string): this { + this.addQualifier(new Qualifier("y", offsetY)); this._actionModel.offsetY = offsetY; return this; } } -export {PositionQualifier}; +export { PositionQualifier }; diff --git a/src/qualifiers/progressive.ts b/src/qualifiers/progressive.ts index d961488..50770c1 100644 --- a/src/qualifiers/progressive.ts +++ b/src/qualifiers/progressive.ts @@ -13,36 +13,33 @@ * const image = yourCldInstance.image('woman'); * image.delivery(format(jpg()).progressive(steep())) */ -import {FlagQualifier} from "./flag/FlagQualifier.js"; - - +import { FlagQualifier } from "./flag/FlagQualifier.js"; class ProgressiveQualifier extends FlagQualifier { constructor(mode?: string) { - super('progressive', mode); + super("progressive", mode); } } - /** * @memberOf Qualifiers.Progressive */ function none(): FlagQualifier { - return new ProgressiveQualifier('none'); + return new ProgressiveQualifier("none"); } /** * @memberOf Qualifiers.Progressive */ function semi(): FlagQualifier { - return new ProgressiveQualifier('semi'); + return new ProgressiveQualifier("semi"); } /** * @memberOf Qualifiers.Progressive */ function steep(): FlagQualifier { - return new ProgressiveQualifier('steep'); + return new ProgressiveQualifier("steep"); } /** @@ -52,23 +49,12 @@ function progressive(): FlagQualifier { return new ProgressiveQualifier(); } - - const Progressive = { semi, none, steep, progressive, - ProgressiveQualifier -}; - -export { - Progressive, - semi, - none, - steep, - progressive, - ProgressiveQualifier + ProgressiveQualifier, }; - +export { Progressive, semi, none, steep, progressive, ProgressiveQualifier }; diff --git a/src/qualifiers/quality.ts b/src/qualifiers/quality.ts index 4762430..6d73088 100644 --- a/src/qualifiers/quality.ts +++ b/src/qualifiers/quality.ts @@ -10,7 +10,9 @@ * @memberOf Qualifiers.Quality * @return {string} */ -function auto():string { return 'auto';} +function auto(): string { + return "auto"; +} /** * @summary qualifier @@ -18,7 +20,9 @@ function auto():string { return 'auto';} * @memberOf Qualifiers.Quality * @return {string} */ -function autoBest():string { return 'auto:best';} +function autoBest(): string { + return "auto:best"; +} /** * @summary qualifier @@ -26,7 +30,9 @@ function autoBest():string { return 'auto:best';} * @memberOf Qualifiers.Quality * @return {string} */ -function autoEco():string { return 'auto:eco';} +function autoEco(): string { + return "auto:eco"; +} /** * @summary qualifier @@ -34,7 +40,9 @@ function autoEco():string { return 'auto:eco';} * @memberOf Qualifiers.Quality * @return {string} */ -function autoGood():string { return 'auto:good';} +function autoGood(): string { + return "auto:good"; +} /** * @summary qualifier @@ -42,7 +50,9 @@ function autoGood():string { return 'auto:good';} * @memberOf Qualifiers.Quality * @return {string} */ -function autoLow():string { return 'auto:low';} +function autoLow(): string { + return "auto:low"; +} /** * @summary qualifier @@ -50,7 +60,9 @@ function autoLow():string { return 'auto:low';} * @memberOf Qualifiers.Quality * @return {string} */ -function jpegmini():string { return 'jpegmini';} +function jpegmini(): string { + return "jpegmini"; +} /** * @summary qualifier @@ -58,7 +70,9 @@ function jpegmini():string { return 'jpegmini';} * @memberOf Qualifiers.Quality * @return {string} */ -function jpegminiBest():string { return 'jpegmini:0';} +function jpegminiBest(): string { + return "jpegmini:0"; +} /** * @summary qualifier @@ -66,7 +80,9 @@ function jpegminiBest():string { return 'jpegmini:0';} * @memberOf Qualifiers.Quality * @return {string} */ -function jpegminiHigh():string { return 'jpegmini:1';} +function jpegminiHigh(): string { + return "jpegmini:1"; +} /** * @summary qualifier @@ -75,12 +91,11 @@ function jpegminiHigh():string { return 'jpegmini:1';} * @memberOf Qualifiers.Quality * @return {string} */ -function jpegminiMedium():string { return 'jpegmini:2';} +function jpegminiMedium(): string { + return "jpegmini:2"; +} -const Quality = {auto, autoBest, autoEco, autoGood, autoLow, jpegmini, jpegminiBest, jpegminiHigh, jpegminiMedium}; - -export { - Quality, +const Quality = { auto, autoBest, autoEco, @@ -89,5 +104,7 @@ export { jpegmini, jpegminiBest, jpegminiHigh, - jpegminiMedium + jpegminiMedium, }; + +export { Quality, auto, autoBest, autoEco, autoGood, autoLow, jpegmini, jpegminiBest, jpegminiHigh, jpegminiMedium }; diff --git a/src/qualifiers/region.ts b/src/qualifiers/region.ts index e829205..d1613c0 100644 --- a/src/qualifiers/region.ts +++ b/src/qualifiers/region.ts @@ -1,5 +1,5 @@ -import {CustomRegion} from "./region/CustomRegion.js"; -import {NamedRegion} from "./region/NamedRegion.js"; +import { CustomRegion } from "./region/CustomRegion.js"; +import { NamedRegion } from "./region/NamedRegion.js"; /** * @summary qualifier @@ -16,7 +16,7 @@ function custom(): CustomRegion { * @return {Qualifiers.Region.NamedRegion} */ function faces(): NamedRegion { - return new NamedRegion('faces'); + return new NamedRegion("faces"); } /** @@ -25,7 +25,7 @@ function faces(): NamedRegion { * @return {Qualifiers.Region.NamedRegion} */ function ocr(): NamedRegion { - return new NamedRegion('ocr_text'); + return new NamedRegion("ocr_text"); } /** @@ -37,4 +37,4 @@ function ocr(): NamedRegion { * @memberOf Qualifiers */ const Region = { ocr, faces, custom }; -export {Region, ocr, faces, custom}; +export { Region, ocr, faces, custom }; diff --git a/src/qualifiers/region/CustomRegion.ts b/src/qualifiers/region/CustomRegion.ts index 2ed2f5c..3df31e3 100644 --- a/src/qualifiers/region/CustomRegion.ts +++ b/src/qualifiers/region/CustomRegion.ts @@ -1,12 +1,12 @@ -import {NamedRegion} from "./NamedRegion.js"; -import {Qualifier} from "../../internal/qualifier/Qualifier.js"; +import { NamedRegion } from "./NamedRegion.js"; +import { Qualifier } from "../../internal/qualifier/Qualifier.js"; /** * @memberOf Qualifiers.Region */ class CustomRegion extends NamedRegion { constructor() { - super('named'); + super("named"); } /** @@ -14,7 +14,7 @@ class CustomRegion extends NamedRegion { * @param {number} x */ x(x: number | string): this { - this.addQualifier(new Qualifier('x', x)); + this.addQualifier(new Qualifier("x", x)); return this; } @@ -23,7 +23,7 @@ class CustomRegion extends NamedRegion { * @param {number} y */ y(y: number | string): this { - this.addQualifier(new Qualifier('y', y)); + this.addQualifier(new Qualifier("y", y)); return this; } @@ -32,7 +32,7 @@ class CustomRegion extends NamedRegion { * @param {number} width */ width(width: number): this { - this.addQualifier(new Qualifier('w', width)); + this.addQualifier(new Qualifier("w", width)); return this; } @@ -41,9 +41,9 @@ class CustomRegion extends NamedRegion { * @param {number} height */ height(height: number): this { - this.addQualifier(new Qualifier('h', height)); + this.addQualifier(new Qualifier("h", height)); return this; } } -export {CustomRegion}; +export { CustomRegion }; diff --git a/src/qualifiers/region/NamedRegion.ts b/src/qualifiers/region/NamedRegion.ts index 6ebc257..208523a 100644 --- a/src/qualifiers/region/NamedRegion.ts +++ b/src/qualifiers/region/NamedRegion.ts @@ -1,16 +1,15 @@ -import {Action} from "../../internal/Action.js"; +import { Action } from "../../internal/Action.js"; /** * @memberOf Qualifiers.Region */ class NamedRegion extends Action { - public regionType: 'faces' | 'ocr_text' | 'named'; + public regionType: "faces" | "ocr_text" | "named"; - constructor(type: 'faces' | 'ocr_text' | 'named') { + constructor(type: "faces" | "ocr_text" | "named") { super(); this.regionType = type; } } - -export {NamedRegion}; +export { NamedRegion }; diff --git a/src/qualifiers/rotate/RotationModeQualifierValue.ts b/src/qualifiers/rotate/RotationModeQualifierValue.ts index 30442b4..0d743a3 100644 --- a/src/qualifiers/rotate/RotationModeQualifierValue.ts +++ b/src/qualifiers/rotate/RotationModeQualifierValue.ts @@ -1,4 +1,4 @@ -import {QualifierValue} from "../../internal/qualifier/QualifierValue.js"; +import { QualifierValue } from "../../internal/qualifier/QualifierValue.js"; /** * @description Acts as a marker for inputs passed into Rotate.mode() @@ -18,5 +18,4 @@ class RotationModeQualifierValue extends QualifierValue { } } - -export {RotationModeQualifierValue}; +export { RotationModeQualifierValue }; diff --git a/src/qualifiers/rotationMode.ts b/src/qualifiers/rotationMode.ts index 215d80d..607d1f8 100644 --- a/src/qualifiers/rotationMode.ts +++ b/src/qualifiers/rotationMode.ts @@ -1,4 +1,3 @@ - /** * @description Contains functions to select the rotation mode. *
      Learn more: {@link https://cloudinary.com/documentation/effects_and_artistic_enhancements#rotating_images|Rotating images} @@ -8,9 +7,7 @@ * @see Visit {@link Actions.Rotate|Rotate Action} for an example */ - - -import {RotationModeQualifierValue} from "./rotate/RotationModeQualifierValue.js"; +import { RotationModeQualifierValue } from "./rotate/RotationModeQualifierValue.js"; /** * @summary qualifier @@ -19,7 +16,7 @@ import {RotationModeQualifierValue} from "./rotate/RotationModeQualifierValue.js * @return {Qualifiers.RotationMode.RotationModeQualifierValue} */ function autoRight(): RotationModeQualifierValue { - return new RotationModeQualifierValue('auto_right'); + return new RotationModeQualifierValue("auto_right"); } /** @@ -29,7 +26,7 @@ function autoRight(): RotationModeQualifierValue { * @return {Qualifiers.RotationMode.RotationModeQualifierValue} */ function autoLeft(): RotationModeQualifierValue { - return new RotationModeQualifierValue('auto_left'); + return new RotationModeQualifierValue("auto_left"); } /** @@ -39,7 +36,7 @@ function autoLeft(): RotationModeQualifierValue { * @return {Qualifiers.RotationMode.RotationModeQualifierValue} */ function verticalFlip(): RotationModeQualifierValue { - return new RotationModeQualifierValue('vflip'); + return new RotationModeQualifierValue("vflip"); } /** @@ -49,10 +46,9 @@ function verticalFlip(): RotationModeQualifierValue { * @return {Qualifiers.RotationMode.RotationModeQualifierValue} */ function horizontalFlip(): RotationModeQualifierValue { - return new RotationModeQualifierValue('hflip'); + return new RotationModeQualifierValue("hflip"); } - /** * @summary qualifier * @description By default, the image is automatically rotated according to the EXIF data stored by the camera when the image @@ -61,16 +57,14 @@ function horizontalFlip(): RotationModeQualifierValue { * @return {Qualifiers.RotationMode.RotationModeQualifierValue} */ function ignore(): RotationModeQualifierValue { - return new RotationModeQualifierValue('ignore'); + return new RotationModeQualifierValue("ignore"); } - -const RotationMode = {autoLeft, autoRight, horizontalFlip, ignore, verticalFlip}; -export { - RotationMode, +const RotationMode = { autoLeft, autoRight, horizontalFlip, ignore, - verticalFlip + verticalFlip, }; +export { RotationMode, autoLeft, autoRight, horizontalFlip, ignore, verticalFlip }; diff --git a/src/qualifiers/shakeStrength.ts b/src/qualifiers/shakeStrength.ts index 8472d1c..02e9573 100644 --- a/src/qualifiers/shakeStrength.ts +++ b/src/qualifiers/shakeStrength.ts @@ -38,16 +38,10 @@ function pixels64(): 64 { } const ShakeStrength = { - pixels16, - pixels32, - pixels48, - pixels64 -}; - -export { pixels16, pixels32, pixels48, pixels64, - ShakeStrength }; + +export { pixels16, pixels32, pixels48, pixels64, ShakeStrength }; diff --git a/src/qualifiers/simulateColorBlind.ts b/src/qualifiers/simulateColorBlind.ts index 213a409..c97dd26 100644 --- a/src/qualifiers/simulateColorBlind.ts +++ b/src/qualifiers/simulateColorBlind.ts @@ -12,7 +12,7 @@ * @return {string} */ function deuteranopia(): string { - return 'deuteranopia'; + return "deuteranopia"; } /** @@ -21,7 +21,7 @@ function deuteranopia(): string { * @return {string} */ function protanopia(): string { - return 'protanopia'; + return "protanopia"; } /** @@ -30,7 +30,7 @@ function protanopia(): string { * @return {string} */ function tritanopia(): string { - return 'tritanopia'; + return "tritanopia"; } /** @@ -39,7 +39,7 @@ function tritanopia(): string { * @return {string} */ function tritanomaly(): string { - return 'tritanomaly'; + return "tritanomaly"; } /** @@ -48,7 +48,7 @@ function tritanomaly(): string { * @return {string} */ function deuteranomaly(): string { - return 'deuteranomaly'; + return "deuteranomaly"; } /** @@ -57,7 +57,7 @@ function deuteranomaly(): string { * @return {string} */ function coneMonochromacy(): string { - return 'cone_monochromacy'; + return "cone_monochromacy"; } /** @@ -66,11 +66,9 @@ function coneMonochromacy(): string { * @return {string} */ function rodMonochromacy(): string { - return 'rod_monochromacy'; + return "rod_monochromacy"; } - - const SimulateColorBlind = { coneMonochromacy, deuteranomaly, @@ -78,7 +76,7 @@ const SimulateColorBlind = { protanopia, rodMonochromacy, tritanomaly, - tritanopia + tritanopia, }; export { @@ -89,6 +87,5 @@ export { protanopia, rodMonochromacy, tritanomaly, - tritanopia + tritanopia, }; - diff --git a/src/qualifiers/source.ts b/src/qualifiers/source.ts index cf357af..24509c8 100644 --- a/src/qualifiers/source.ts +++ b/src/qualifiers/source.ts @@ -1,9 +1,9 @@ -import {VideoSource} from "./source/sourceTypes/VideoSource.js"; -import {ImageSource} from "./source/sourceTypes/ImageSource.js"; -import {TextStyle} from "./textStyle.js"; -import {SubtitlesSource} from "./source/sourceTypes/SubtitlesSource.js"; -import {FetchSource} from "./source/sourceTypes/FetchSource.js"; -import {TextSource} from "./source/sourceTypes/TextSource.js"; +import { VideoSource } from "./source/sourceTypes/VideoSource.js"; +import { ImageSource } from "./source/sourceTypes/ImageSource.js"; +import { TextStyle } from "./textStyle.js"; +import { SubtitlesSource } from "./source/sourceTypes/SubtitlesSource.js"; +import { FetchSource } from "./source/sourceTypes/FetchSource.js"; +import { TextSource } from "./source/sourceTypes/TextSource.js"; /** * @description This namespace contains different sources that can be used in overlays and underlays @@ -13,7 +13,6 @@ import {TextSource} from "./source/sourceTypes/TextSource.js"; * @see {@link Actions.Underlay| The underlay action} */ - /** * @summary qualifier * @description Returns an instance of an ImageSource @@ -70,6 +69,5 @@ function fetch(remoteURL: string): FetchSource { return new FetchSource(remoteURL); } - -const Source = {image, text, video, subtitles, fetch}; -export {Source, image, text, video, subtitles, fetch}; +const Source = { image, text, video, subtitles, fetch }; +export { Source, image, text, video, subtitles, fetch }; diff --git a/src/qualifiers/source/BaseSource.ts b/src/qualifiers/source/BaseSource.ts index 6ce66ac..08afa99 100644 --- a/src/qualifiers/source/BaseSource.ts +++ b/src/qualifiers/source/BaseSource.ts @@ -1,15 +1,14 @@ -import {Transformation} from "../../transformation/Transformation.js"; -import {ImageTransformation} from "../../transformation/ImageTransformation.js"; -import {QualifierModel} from "../../internal/models/QualifierModel.js"; - +import { Transformation } from "../../transformation/Transformation.js"; +import { ImageTransformation } from "../../transformation/ImageTransformation.js"; +import { QualifierModel } from "../../internal/models/QualifierModel.js"; /** * @memberOf Qualifiers.Source * @extends {QualifierModel} * @description An abstract class extended by all Source objects */ -abstract class BaseSource extends QualifierModel{ - protected _transformation:Transformation; +abstract class BaseSource extends QualifierModel { + protected _transformation: Transformation; /** * @description Utility function to encode an asset publicID in an overlay @@ -18,7 +17,7 @@ abstract class BaseSource extends QualifierModel{ * encodeAssetPublicID('foo/bar'); // -> foo:bar */ protected encodeAssetPublicID(publicID: string): string { - return publicID.replace(/\//g, ':'); + return publicID.replace(/\//g, ":"); } /** * @description @@ -40,7 +39,7 @@ abstract class BaseSource extends QualifierModel{ return this._transformation; } - abstract getOpenSourceString(layerType: 'u' | 'l'): string + abstract getOpenSourceString(layerType: "u" | "l"): string; } -export {BaseSource}; +export { BaseSource }; diff --git a/src/qualifiers/source/sourceTypes/BaseTextSource.ts b/src/qualifiers/source/sourceTypes/BaseTextSource.ts index 09fff38..7b858d8 100644 --- a/src/qualifiers/source/sourceTypes/BaseTextSource.ts +++ b/src/qualifiers/source/sourceTypes/BaseTextSource.ts @@ -1,12 +1,12 @@ -import {BaseSource} from "../BaseSource.js"; -import {SystemColors} from "../../color.js"; -import {TextStyle} from "../../textStyle.js"; -import {serializeCloudinaryCharacters} from "../../../internal/utils/serializeCloudinaryCharacters.js"; -import {Action} from "../../../internal/Action.js"; -import {Qualifier} from "../../../internal/qualifier/Qualifier.js"; -import {prepareColor} from "../../../internal/utils/prepareColor.js"; -import {IBaseTextSourceModel} from "../../../internal/models/ITextSourceModel.js"; -import {TextFitQualifier} from "../../textFit.js"; +import { BaseSource } from "../BaseSource.js"; +import { SystemColors } from "../../color.js"; +import { TextStyle } from "../../textStyle.js"; +import { serializeCloudinaryCharacters } from "../../../internal/utils/serializeCloudinaryCharacters.js"; +import { Action } from "../../../internal/Action.js"; +import { Qualifier } from "../../../internal/qualifier/Qualifier.js"; +import { prepareColor } from "../../../internal/utils/prepareColor.js"; +import { IBaseTextSourceModel } from "../../../internal/models/ITextSourceModel.js"; +import { TextFitQualifier } from "../../textFit.js"; /** * @memberOf Qualifiers.Source @@ -16,9 +16,9 @@ import {TextFitQualifier} from "../../textFit.js"; class BaseTextSource extends BaseSource { private text: string; protected _textStyle: TextStyle | string; - protected _textColor: SystemColors - protected _backgroundColor: SystemColors - protected type = 'text'; + protected _textColor: SystemColors; + protected _backgroundColor: SystemColors; + protected type = "text"; protected _qualifierModel: Partial; protected _textFit: TextFitQualifier; @@ -27,32 +27,32 @@ class BaseTextSource extends BaseSource { this.text = text; this._textStyle = textStyle; - this._qualifierModel.sourceType = 'text'; + this._qualifierModel.sourceType = "text"; this._qualifierModel.text = text; - if (textStyle instanceof TextStyle){ + if (textStyle instanceof TextStyle) { this._qualifierModel.textStyle = textStyle.toJson(); } } - encodeText(text:string): string { + encodeText(text: string): string { return serializeCloudinaryCharacters(text); } - textColor(color:SystemColors): this { + textColor(color: SystemColors): this { this._textColor = color; this._qualifierModel.textColor = color; return this; } - backgroundColor(bgColor:SystemColors): this { + backgroundColor(bgColor: SystemColors): this { this._backgroundColor = bgColor; this._qualifierModel.backgroundColor = bgColor; return this; } - textFit(textFit:TextFitQualifier){ + textFit(textFit: TextFitQualifier) { this._textFit = textFit; return this; } @@ -63,23 +63,20 @@ class BaseTextSource extends BaseSource { * This method is used internally within {@link SDK.LayerAction|LayerAction} * @returns {string} */ - getOpenSourceString(layerType: 'u' | 'l'): string { - const layerParam = [ - this.type, - this._textStyle && this._textStyle.toString(), - this.encodeText(this.text) - ].filter((a) => a).join(':'); - + getOpenSourceString(layerType: "u" | "l"): string { + const layerParam = [this.type, this._textStyle && this._textStyle.toString(), this.encodeText(this.text)] + .filter((a) => a) + .join(":"); const tmpAction = new Action(); tmpAction.addQualifier(new Qualifier(layerType, layerParam)); - this._textColor && tmpAction.addQualifier(new Qualifier('co', prepareColor(this._textColor))); - this._backgroundColor && tmpAction.addQualifier(new Qualifier('b', prepareColor(this._backgroundColor))); + this._textColor && tmpAction.addQualifier(new Qualifier("co", prepareColor(this._textColor))); + this._backgroundColor && tmpAction.addQualifier(new Qualifier("b", prepareColor(this._backgroundColor))); this._textFit && tmpAction.addQualifier(this._textFit); return tmpAction.toString(); } } -export {BaseTextSource}; +export { BaseTextSource }; diff --git a/src/qualifiers/source/sourceTypes/FetchSource.ts b/src/qualifiers/source/sourceTypes/FetchSource.ts index c7b5408..a02811c 100644 --- a/src/qualifiers/source/sourceTypes/FetchSource.ts +++ b/src/qualifiers/source/sourceTypes/FetchSource.ts @@ -1,8 +1,8 @@ -import {BaseSource} from "../BaseSource.js"; -import {FormatQualifier} from "../../format/FormatQualifier.js"; -import {base64Encode} from "../../../internal/utils/base64Encode.js"; -import {ITransformationFromJson} from "../../../internal/models/IHasFromJson.js"; -import {IFetchSourceModel} from "../../../internal/models/IFetchSourceModel.js"; +import { BaseSource } from "../BaseSource.js"; +import { FormatQualifier } from "../../format/FormatQualifier.js"; +import { base64Encode } from "../../../internal/utils/base64Encode.js"; +import { ITransformationFromJson } from "../../../internal/models/IHasFromJson.js"; +import { IFetchSourceModel } from "../../../internal/models/IFetchSourceModel.js"; /** * @memberOf Qualifiers.Source @@ -14,7 +14,7 @@ import {IFetchSourceModel} from "../../../internal/models/IFetchSourceModel.js"; * This class is used as a Qualifier for the asset.overlay() and asset.underlay() methods.
      * You can find regular images and videos transformations below: *

      - *